开发者

Execute jQuery after other scripts?

开发者 https://www.devze.com 2023-01-04 18:22 出处:网络
I\'m trying to 开发者_JAVA技巧use jQuery to change some styling on my page. The page is made dynamically by executing another JavaScript file.

I'm trying to 开发者_JAVA技巧use jQuery to change some styling on my page. The page is made dynamically by executing another JavaScript file.

Right now I have

$(window).load(function(){
    $('p').css('font','green');
});

Which does nothing.

$(document).ready(function() will change the static part of the page, but not the generated part.

If I just type $('p').css('font','green'); in the console, the expected results will happen. What is going on?


I'm guessing you are asking to be able to bind events to objects?

If so, look up the jQuery live() function: http://api.jquery.com/live/

If you are simply trying to apply CSS Styles to the page, you're better off relying on actual CSS style sheets.


Instead of listening for the document ready event, can you listen to an event fired by a workcomplete script building the page?

Or can you test for something in the page to indicate it's done every 100ms and then fire such an event yourself?

0

精彩评论

暂无评论...
验证码 换一张
取 消