Fire Dragon Posted January 25, 2006 Share Posted January 25, 2006 I know how put JS to html document,but can I html clips to JS?I mean example,when you press button,it calls function,what creates image to page.So how I can put that <img src="image.gif"> code in javascript code?I need some this kind effects,so I need to know,how make it.Thanks! Link to comment Share on other sites More sharing options...
scott100 Posted January 25, 2006 Share Posted January 25, 2006 use a document.write()<script>document.write('<img src="image.gif">');</script> Link to comment Share on other sites More sharing options...
Fire Dragon Posted January 26, 2006 Author Share Posted January 26, 2006 I tried it,but I can't get it work.Here is my code:What is wrong about it? <html><head></head><body><script type="javascript">document.write("<img src="furret.gif">");</script></body></html> Link to comment Share on other sites More sharing options...
pulpfiction Posted January 26, 2006 Share Posted January 26, 2006 Replace the double qoutes with single quotes in document.write. like below<script language=javascript>document.write('<img src="OJA-Logo.jpg">')</script> Link to comment Share on other sites More sharing options...
Eric Posted January 26, 2006 Share Posted January 26, 2006 @ Fire Dragon,To be valid, where you have <script type="javascript"> you should add 'text' in there like this <script type="text/javascript">@ pulpfiction,the 'language' attribute isn't a valid attribute anymore Link to comment Share on other sites More sharing options...
Fire Dragon Posted January 27, 2006 Author Share Posted January 27, 2006 Thanks.Now I understand. 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