I've been programming lately and this week I had Google Chrome web browser not work correctly. I was using jQuery JSON and AJAX, and tried to view a webpage source and these three instances didn't work in Chrome but worked perfectly in Firefox. I don't know if the issue is because I'm using it natively on my desktop to test, I hope it is. Chrome is a good browser to surf the internet but not the best to test your code. Imagine the frustration of coming to a conclusion that a code doesn't work but later finding out it works because chrome doesn't work when using local files. That's a bunch a BS.
I would say "I hope they fix that" but I'm going to do what I can control. I'm switching to Firefox.
Showing posts with label AJAX. Show all posts
Showing posts with label AJAX. Show all posts
Wednesday, September 7, 2011
Friday, September 2, 2011
jQuery AJAX .load()
jQuery AJAX is wonderfully powerfull. The more I use it the more I like it. Its very simple compared to the pure AJAX javascript code. jQuery has a couple of different AJAX syntax but the simplest is the .load(). Choose which element you want to target and which location/file you want to pull content from. Barabam AJAX.
Example:
$('div').load('test.html');
Above changes the div tag in current page to the test.html
One cool feature is the ability to pull a selected portion of the location by having a space after the location name and specifying the part.
Example:
$('div').load('test.html #content');
Above changes the div tag in current page to the test.html where the id equals "content"
More information check .load() – jQuery API
Example:
$('div').load('test.html');
Above changes the div tag in current page to the test.html
One cool feature is the ability to pull a selected portion of the location by having a space after the location name and specifying the part.
Example:
$('div').load('test.html #content');
Above changes the div tag in current page to the test.html where the id equals "content"
More information check .load() – jQuery API
Subscribe to:
Comments (Atom)