Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-21-2011, 01:46 PM   PM User | #1
Eben
New Coder

 
Join Date: May 2006
Posts: 48
Thanks: 1
Thanked 0 Times in 0 Posts
Eben is an unknown quantity at this point
$.ajax and hash(#)

i couldn't find how to use it,
when using load i can do
Code:
$('#mydiv').load('myurl.php #div')
this code doesn't work

Code:
$.ajax({
    url: 'myurl.php #div',
    success: function(data) {
       $("#mydiv").html(data);
}
    });
__________________
Firebug for Internet Explorer
Eben is offline   Reply With Quote
Old 09-21-2011, 02:11 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
I've only ever used load to do it that way so I didn't realize it, but I think it is an actual limitation. based on the wording below from the API I think it's intended. Is there any reason you have to use .ajax()? you can use the same type of callback and so forth you would with .ajax

Quote:
The $.ajax() function underlies all Ajax requests sent by jQuery. It is often unnecessary to directly call this function, as several higher-level alternatives like $.get() and .load() are available and are easier to use. If less common options are required, though, $.ajax() can be used more flexibly.
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:37 PM.


Advertisement
Log in to turn off these ads.