Hello there! This is a simple question. I need to be able to change the URL of my website with AJAX, without refreshing the site, and executing the JS command. (Sound cool, but is it possible?) I mean, I am on www.EXAMPLE.com , so I click on a link and it does the JS thing and URL changes to www.EXAMPLE.com/?example=1 (for example) I don't know if it's possible, do you know any way to do that?? (without refreshing)! Very Appreciated!! Thanks
You have to get the new content using the httprequest object. Then you can replace the content of a div or table element using the innerHTML property. EDIT: See the following script. Visit the demo. http://www.dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-content
I dont think it is possible to change the browser's address bar content with javascript. This is for security reasons - you wouldn't want someone to be able to change the displayed url "http://www.hackerssite.com/" to "https://www.paypal.com" to dupe you into entering your paypal details for example
Hello, thanks for your help, but that's not what I was looking for. I am not looking for AJAX to load contents (I have already found that) What I want to do is change the URL (using AJAX ) without refreshing, for example www.EXAMPLE.com/?video=21
OH, MattD you posted while I was writing hehe. So it's not possible :'( I thought that changing the entire URL is not possible, but I can't even the "filename" of the url?? (index.html --> index2.html) EDIT: If you want to know what I mean you can enter http://www.chetos.es/ajax.php All videos are played with, javascript:loadFile('URLTOVIDEO') , for example javascript:loadFile('/videos/21.flv') but with that , an user can't link directly to a video. (for example http://www.chetos.es/ajax.php?video=21 , it will load video 21 also.) So I would like that when someone clicks on a video, it starts playing with "loadFile", but also change the URL so the user can link directly to the video. I know it sounds difficult... but there's nothing I can do?? What do you recommend me doing?? Thanks
Think you'd need a link on the flv or something that will give you the link directly to the video (like the youtube "share this" button) really for this sort of thing.
I know this thread is a tiny bit old but I just found it on a search so... You can use something called SWFAddress to solve your AJAX(or even Flash) URL woes. It appends /#/yoursubfolder to the end of your URL string. I have used it only for flash movies and it works like a charm. Check out my site(http://www.podereilcasale.it) for a sample. Here's the link for SWFAddress http://www.asual.com/swfaddress/
why not open a window with the actual video url? if not, why not write the "direct access" url under the video?