Forum closed. New forum available at http://community.wymeditor.org/

Load css out from js

Support forum for WYMeditor.

Load css out from js

Postby backflip on Tue Jul 10, 2007 10:00 pm

I'd like to load the css out from the javascript because it's not always easy to put the css in the header (when the editor is dynamically loaded into the body).

Now i took a function from HTMLAREA and placed it at the beginning of the js:
Code: Select all
loadStyle = function() {
   var url = '/xy.css';   
   var head = document.getElementsByTagName("head")[0];
   var link = document.createElement("link");
   link.rel = "stylesheet";
   link.href = url;
   head.appendChild(link);
};
loadStyle();

As far as I could test it works in most browsers.

Because I wanted to use jquery instead of this 'old' code, I tried
Code: Select all
$(function(){
   $('head').append('<link rel="stylesheet" href="/wymeditor/skins/default/screen.css" type="text/css">');
});

Now the css doesn't apply in IE.


Does anybody know how to solve this with jquery?
Would it be possible to integrate this into the next version of Wymeditor (if there exists a working solution)?
backflip
 
Posts: 1
Joined: Tue Jul 10, 2007 9:53 pm

Postby jfh on Wed Jul 18, 2007 8:16 am

Thanks for pointing the issue.
Ticket #65 created.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest