Forum Moderators: open

Message Too Old, No Replies

AJAX not working on domain.com but works fine on localhost

external page is loading on testing server but not loading on web server

         

mp3mechanical

11:48 am on Feb 8, 2007 (gmt 0)

10+ Year Member



hi all,
i am using a ajax script for loading a external html page into a <div> tag within my page.
for this is use dhtmlgoddies.com's script ( [dhtmlgoodies.com...] )

this scripts works fine when i test it with my testing server (uniform server) on localhost, but when i uploaded the files on my site domain.com ;it doesnt load external page.

is this a problem related to my website's server configuration or script implementation problem.

please help me.
thanks.

cmarshall

3:16 pm on Feb 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a feeling that this may have to do with the contents of the file you are embedding. Try different sources.

Thanks for the tip on DHTMLGoodies. Great site.

daveVk

11:45 pm on Feb 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Security prevents cross domain ajax requists.

[msdn.microsoft.com...]

mp3mechanical

7:00 am on Feb 9, 2007 (gmt 0)

10+ Year Member



how can it be an error of croos domain , while i am using both pages in same domain & in same folder too.
and this script is working fine on dhtmlgoddies.com .
so why not working on my server.
anu clue?
help me......this bug is annoying me..

cmarshall

12:14 pm on Feb 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, Dave is correct. You can't send an HTTPRequest to a server outside your own domain. I think there's an Apache setting that you can specify to allow this (which may be why you can do it on your machine), but most ISPs don't allow this, for very good reason.

I shudder to think how it could be abused if not for this feature.

All three of the external files in the DTMLGoodies example are local to the including file.

In any case, this is an issue that has affected me. I have had to redesign my sites to accommodate this. Sorry I forgot about it.

Basically, you can't get there from here.

The way you solve this is to use a PHP file as a "router." You HTTPRequest to the file, then it does a URI include to the external site.