Link to home
Start Free TrialLog in
Avatar of Steve
SteveFlag for Australia

asked on

JavaScript not working with jQuery .load() dynamic content

I am making a site that calls data in from another location using the jQuery .load() event. However, the content that has been brought in cannot interact with the JavaScript currently on the page.

In the below page, I have programmed it to to load content based on the anchor link that is clicked or what is loaded in from the address bar in a browser.

This works fine for all the static links on the page but NOT the links that have been loaded dynamically.

Is there a way to get my code to see the links in the dynamic data that has been imported?


http://ag-chartered-accountants.com/dynamic/what.php#it-solutions

Called in from

http://ag-chartered-accountants.com/dynamic/what-cms.php

(view source to see code)

Also, is there a way to load both the HTML and JavaScript into a DIV using jQuery?

Many thanks,

Mark
ASKER CERTIFIED SOLUTION
Avatar of chuckalicious
chuckalicious
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve

ASKER

Thanks that works a treat.

The odd thing is I had already tried this, I must have done something wrong somewhere. Your comment gave me confidence that I was on the right track, so now I've gone back and done it again properly and it's working great :o)

Thanks again

Mark
Avatar of Michel Plungjan
Please note the .live event handler has been superseded by the .on event handler