There is a method in jQuery made specifically for that:

$('#content').load("/help/faq #107");

That's all. Notice the white space between the hash. It's not a
location hash anymore, but a selector that will filter the output. And
the URL has to be in your own site, ajax doesn't work cross-domain.

Docs:
http://docs.jquery.com/Ajax/load#urldatacallback

On Jun 10, 1:42 pm, waseem sabjee <waseemsab...@gmail.com> wrote:
> do you mean extract a specific div from an external URL ?
> if so this will work.
>
> $.ajax({
> URL : "http://www.domain.com/help/faq#107";,
> success: function(html) {
> var thediviwant = $("#topnav", html).html();
> $("body").prepend(thediviwant);
>
>
>
> }
> });
> On Wed, Jun 10, 2009 at 4:43 PM, deltaf <j...@deltafactory.com> wrote:
>
> > Can you check the url during the ready() on the FAQ page and various
> > click() events within the page to create this effect?
>
> > On Jun 10, 6:24 am, Bennobo <benn...@googlemail.com> wrote:
> > > Can I teach jquery to open a specific <div> by URL?
>
> > > Example:http://www.domain.com/help/faq#107
>
> > > The FAQ Entry with ID 107 should open immediatly when I go to this
> > > URL. (show/hide)
>
> > > Have a nice day!
> > > Bennobo

Reply via email to