{"id":20023990,"url":"https://github.com/thebojda/jqueryajaxform","last_synced_at":"2025-09-09T00:35:55.368Z","repository":{"id":31747183,"uuid":"35313265","full_name":"TheBojda/jqueryajaxform","owner":"TheBojda","description":"Automatically exported from code.google.com/p/jqueryajaxform","archived":false,"fork":false,"pushed_at":"2015-05-09T14:23:53.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T00:35:49.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheBojda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-09T03:23:46.000Z","updated_at":"2015-05-09T03:27:36.000Z","dependencies_parsed_at":"2022-08-29T16:00:54.088Z","dependency_job_id":null,"html_url":"https://github.com/TheBojda/jqueryajaxform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheBojda/jqueryajaxform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fjqueryajaxform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fjqueryajaxform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fjqueryajaxform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fjqueryajaxform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheBojda","download_url":"https://codeload.github.com/TheBojda/jqueryajaxform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBojda%2Fjqueryajaxform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231101,"owners_count":25245687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T08:48:52.662Z","updated_at":"2025-09-09T00:35:55.339Z","avatar_url":"https://github.com/TheBojda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple, small (1.3K) ajax form implementation based on jQuery. \n\n**Usage:** Simply add ajaxform class, and a hidden input with \"ajaxform_refresh\" name which contains the ids of elements have to be refreshed. After the form submit, only the given fields will be refreshed, instead of the whole page. You don't have to change anything on the server side, but it is possible to give back only the referenced parts of the result to reduce the bandwidth usage, and usage of server resources.  \n\n**How dose it work:** The ajaxform utility is a small script based on jQuery which search the forms with ajaxform classes, and changes the target of these to a hidden iframe. After the form submit the script will copy back the given elements to the original HTML. This method prevents the ugly page refreshes, and makes easier to do some magic, like change a simple text part to textarea, or build dynamic ajax trees and tables without javascript components or special server codes.  \n\nExample:\n\n```html\n  \u003cscript type=\"text/javascript\" src=\"ajaxform.js\" /\u003e\n\n  ...\n\n  \u003cspan id=\"content\"\u003e\n    \u003cform method=\"post\" class=\"ajaxform\"\u003e\n      \u003cinput type=\"hidden\" name=\"ajaxform_refresh\" value=\"content\" /\u003e\n      ...\n      \u003cinput type=\"submit\" name=\"submit_button\" value=\"Submit!\" /\u003e\n    \u003c/form\u003e\n    ...\n  \u003c/span\u003e\n```\n\n*Unobtrusive javascript with ajaxform:* Using unobtrusive javascripts with the ajaxform needs some extra programming, because these should run only on the original HTML page. If these scripts would be in the header, like in the standard solution, the DOM would be changed in the iframe, and this changed DOM would be copied back to the original page. This mechanism kills the attached event handlers. For this reason all of these scripts have to be placed in the ajaxform_init function which will be called after every refresh. When javascript loading is needed, use $.geScript() jQuery function. \n\nExample:\n\n```html\n  \u003cscript type=\"text/javascript\"\u003e\n    function ajaxform_init() {\n      // load javascript instead of \u003cscript src=...\n      $.getScript('some_unobtrusive_javascript.js');\n      \n      // jQuery event handler instead of $(document).ready() \n      $('#some_button').click(function() {\n        $('#popup').fadeIn('slow');\n      });\n    }\n  \u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebojda%2Fjqueryajaxform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebojda%2Fjqueryajaxform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebojda%2Fjqueryajaxform/lists"}