jigarshah Posted October 9, 2006 Share Posted October 9, 2006 I want to include <link href="http://www.myplace.com/my_css.css" type="text/css" rel="stylesheet" /> in head section after some javascript validation how can i do that ? Link to comment Share on other sites More sharing options...
Guest orang flores Posted October 10, 2006 Share Posted October 10, 2006 I want to include <link href="http://www.myplace.com/my_css.css" type="text/css" rel="stylesheet" /> in head section after some javascript validation how can i do that ?I'm not sure what do you mean, but if you want to connect the external css file to your page it should looks like this <link rel="stylesheet" type="text/css" href="http://www.myplace.com/my_css.css"> it works on my page anyway.As long as javascript placed between<script type="text/javascript">and </script> the same goes with CSS placed between <style type="text/css"> and </style> it doesn't matter how you place them there, but making sure it is place them between <head> and </head>sorry if this isn't the right answer Link to comment Share on other sites More sharing options...
scott100 Posted October 10, 2006 Share Posted October 10, 2006 I want to include <link href="http://www.myplace.com/my_css.css" type="text/css" rel="stylesheet" /> in head section after some javascript validation how can i do that ? <head><script> //put javascript here</script><link rel="stylesheet" type="text/css" href="http://www.myplace.com/my_css.css" /></head> Link to comment Share on other sites More sharing options...
Jonas Posted October 10, 2006 Share Posted October 10, 2006 I think he only wants the css to apply if some javascript validation holds true..?<script type="text/javascript">if (true) {document.write('<link rel="stylesheet" type="text/css" href="http://www.myplace.com/my_css.css" />');}</script>But if this is the case I'd rather include it with a serverside script, because that javascript thing won't validate, as the <link> element isn't allowed within <script> tags... Link to comment Share on other sites More sharing options...
scott100 Posted October 11, 2006 Share Posted October 11, 2006 I think he only wants the css to apply if some javascript validation holds true..?doh! i think you may be right Jonas Link to comment Share on other sites More sharing options...
Jonas Posted October 11, 2006 Share Posted October 11, 2006 Well, duh... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now