This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

jQuery in action, problem with the examples

 
Ranch Hand
Posts: 50
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
some time ago I learned jQuery by jQuery in action book, and I used a lot the examples included in the book using Firefox.

Now I have tried to run again that examples (principally lab.operation.html - chapter 2) but they don't work anymore and I have to access to them using a webserver.
In the example page, they don't show the "DOM Sample" and "DOM Sample Code", they are simply empty.
In the source code I see there is an ajax request but I 'm pretty sure that before I didn't use a webserver.

At the beginning I thought it was a problem about the browser (maybe some update changed something) but also with other browsers (Chrome, IE, Opera) I have the same issue.
I know you are not sorcerer, but do you have some kind of idea why now they don't call the ajax request?

Thanks,
KK
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Karim Kiswarday wrote: and I have to access to them using a webserver.


Do you mean as opposed to simply opening the files directly in the browser? Then yes. Ajax won't work correctly when using the file protocol, the files must be served by an HTTP server.

You can verify this by visiting the online version of the examples at http://www.bibeault.org/jqia2
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic