Friday 16 September 2011

Changing emeded content with JavaScript?

I'm new to this webcoding buisness, but i was working on a site using the scriptalisious things, but i have noticed that everytime I call my PHP changes (index.php?thing=that%26amp;those=this) it refreshed the page and all the javascript things restart. I've managed to dynamically change the a picture by copying the code from Dreamweaver, but now I am stuck changing my flash videos.... anyone?Changing emeded content with JavaScript?You can never go back to the php.



but you can have the php come to you!



it's called ajax, you keep the current page, but make a little call back to the server, and it calls a new php page, and you get it's results. you are still inside your javascript on the current page!



You are not alone! everybody needs to learn ajax (or some parts of it)



I use a library called jquery (http://jquery.com), you can add a few lines of code, and get your php callback to update your page!



Yeah... a few lines of code, not dozens or hundreds!