Javascript Issues General

Mutliple Incudes of Jquery? This can cause things to inexplicably fail – view page source and make sure you don’t have multiple …/jquery … .js files To test if Jquery is present or not use something like this, and call it if not present http://css-tricks.com/snippets/jquery/load-jquery-only-if-not-present/

Read More

Reload page

Reload the current page Form reloads current page Link reloads current page Reload current page but with post values stripped Using javascript Periodic Refresh

Read More

Invent Partners Concertina Menu

This is similar to the jQuery Accordion menu, but improves on it by allowing multiple sections to be open at once and remembering state when changing pages etc via a cookie. Invent Partners Concertina Menu

Read More

jQuery Accordion

This jQuery menu is great for vertical menus, but its limitation is that it won’t remember state when changing pages. jQuery Accordion In your header <!–JQuery Accordion menu start –> <link href=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css” rel=”stylesheet” type=”text/css”/> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js”></script> <script src=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js”></script> <script> $(document).ready(function() { $(“#accordion”).accordion( {collapsible: true, active: false} ); }); </script> <!–JQuery Accordion menu end –> In […]

Read More

Submit form

document.getElementById(‘uploaded_dest_file_name’).value=”[var.upload_filename]”; document.forms[“form_upload_complete”].submit();

Read More

Adding a variable to a form

Create the form <form id=”my_form_name” name=”my_form_name” method=”post” action=”http://www.mydomain.com/destination_page.php”> <input type=”hidden” name=”form_parameter1″ id=”form_parameter1″ value=”” /> <!– etc… –> </form> Create the variable <script type=”text/javascript”> var parameter1 = ‘TEST’; </script> To load the form field with the varaible document.getElementById(‘form_parameter1’).value=parameter1; //If you want to auto submit the form document.forms[“my_form_name”].submit();

Read More

Redirecting

Redirect To A New Page <script type=”text/JavaScript”> window.location = “http://www.mydomain.com” </script>”; Redirect With POST Data Using A Hidden Form Include the hidden form with the values you want to send on the page: <!– ———————————————– –> <!– HIDDEN FORM AUTO SUBMITTED ON UPLOAD COMPLETION –> <!– ———————————————– –> <form id=”form_upload_complete” name=”form_upload_complete” method=”post” action=”http://www.mydomain.com/successful_upload.php”> <input type=”hidden” […]

Read More