How to make a page redirect using Javascript?
window.location = "http://my.url.here";
Here's some quick-n-dirty code that uses jQuery to do what you want. I highly recommend using jQuery. It'll make things a lot more easier for you, especially since you're new to Javascript.
ContentMiddleAd
ContentMiddleAd
You can append the values in query string for next page to see and process. You can wrap them inside the link tags:
href="your_page.php?var1=value1&var2=value2">
You separate each of those values with the & sign.
Or you can create this on button click like this:
="button" onclick="document.location.href = 'your_page.php?var1=value1&var2=value2';">
ContentMiddleAd
document.location.href="http://yoursite.com"+ document.getElementById('somefield');
That would get the value of some text field or hidden field, and add it to your site url to get a new URL (href). You can modify this to suit your needs.
No comments:
Post a Comment