Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,173,914 members, 7,890,032 topics. Date: Monday, 15 July 2024 at 07:57 AM |
Nairaland Forum / Science/Technology / Programming / Javascript View Source Problem (need Help) (760 Views)
Can I Claim Expert In Html,javascript,css & Php After 1yrs Of Constant Learning? / Were Can I Download Free Video Tutorials On Javascript Or Ruby / My Web Development Consultancy Thread(html, CSS, Javascript, Jquery, ASP.NET) (2) (3) (4)
(1) (Reply)
Javascript View Source Problem (need Help) by wolkodav007: 2:07am On Aug 23, 2015 |
Maybe you can just short it like I have a code but it doesn't work as it is not in correct form. Please help me correcting the right form and see if there is any mistake in coding. Ps I don't know about coding well but I would like to learn it. I'd be thankful if any of you can suggest me. <html> <head> <script language="javascript"type="text/javascript"> <!-- Begin function viewSource(){document.getSource.view.value="Please wait!";setTimeout("document.getSource.view.value='View Source!'",6000);window.location.href="view-source:"+document.getSource.url.value;returnfalse;}// End --></script>Type in a full URL and click "View Source"</head> <form name=getSource onSubmit="return viewSource();"><input type=text name=url value="http://"/><input type=submit name=view value="View Source"/></form> </html> |
Re: Javascript View Source Problem (need Help) by thewebcraft(m): 12:10pm On Aug 24, 2015 |
Hello Use this, it works. <html> <head> </head> <body> <input type="text" id="url" placeholder="Enter an address"/> <input type="submit" onclick="viewSource();" value="View Source"/> <script language="javascript"type="text/javascript"> function viewSource(){ //You dont need a form for that this loads a new page and views the source.. window.location.href="view-source:"+document.getElementById('url').value; } </script> </body> </html> |
(1) (Reply)
Win @cmapit's N100,000 For Developers / Nope / Relative Layout (android Development)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9 |