Javascript View Source Problem (need Help) - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Javascript View Source Problem (need Help) (818 Views)
1 Reply
| Javascript View Source Problem (need Help) by wolkodav007(op): 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> |
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
Get It Done Today • Promo!!! Ecommrce Site For SLASH!!! 54,000 NAIRA!!! • Common Security Issues Faced During Mobile App Development