Select to view content in your preferred language

Copy and paste of code not working in notepad

2451
5
08-27-2012 09:18 PM
abhijithsastry
New Contributor
Dear all,

Please help me. The live samples are working when i view it in the browser, but when i copy the code into notepad and run it as a local copy in the browser. The code is not working, nothing is being displayed.

Can you please help me???
0 Kudos
5 Replies
DavideLimosani
Frequent Contributor
You should put the text file under you local web server, for example in the wwwroot folder if you are working with IIS, and run it in localhost.

To be sure that this is the problem try using the api 2.8 instead of 3.0. In this case the script should work from any path.

Davide
0 Kudos
DavideLimosani
Frequent Contributor
In my experience 3.0 api works only on a web server...
0 Kudos
__Rich_
Deactivated User
In my experience 3.0 api works only on a web server...

He's not talking about hosting the API, he's talking about a sample not working.
0 Kudos
DavideLimosani
Frequent Contributor
He's not talking about hosting the API, he's talking about a sample not working.


I'm not talking about it either.

Here there is a thread about this issue

http://forums.arcgis.com/threads/61584-Sample-scripts-no-longer-work-since-upgrade-to-v3.0-of-the-AP...
0 Kudos
__Rich_
Deactivated User
I'm not talking about it either.

Here there is a thread about this issue

http://forums.arcgis.com/threads/61584-Sample-scripts-no-longer-work-since-upgrade-to-v3.0-of-the-AP...

My apologies, guess I've just got lucky so far - haven't had a problem with a sample before.

Having tried the Hover sample referenced in that other thread it has a problem in FF but not in IE, different implementation of cross-domain security...there's a surprise *rolls eyes* (ah, I see, again, IE not really into CORS yet!)

edit: just noticed all the 'quick' (i.e. filesystem-hosted) samples I've got lying around are pre 3.0...that explains it!

edit2: ah, I see, because serving the page from the filesystem produces a value of null for the HTTP request header "Origin" this cannot be used to authorise for CORS purposes.
0 Kudos