Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
104
rated 0 times [  109] [ 5]  / answers: 1 / hits: 17630  / 14 Years ago, mon, february 14, 2011, 12:00:00

i want to append a style sheet(css) link to the head of an iframe using jquery .
i tried with the following code but not working.



$('#tabsFrame').contents().find(head).append(cssLink);

More From » jquery

 Answers
21

i am used to append data to an iframe by using this line of code



$('body', window.frames[target].document).append(data);



In your case, this line would look like this



$('head', window.frames['tabsFrame'].document).append(cssLink);



EDIT:



Add <head></head> to the iframe and change your var cssLink to



cssLink = '<link href=cupertino_1.4/css/cupertino/jquery-ui-1.8.7.custom.css type=text/css rel=Stylesheet class=ui-theme />


[#93749] Friday, February 11, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
daijab

Total Points: 60
Total Questions: 99
Total Answers: 110

Location: Bosnia and Herzegovina
Member since Thu, Jun 24, 2021
3 Years ago
;