Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,802 members, 7,810,090 topics. Date: Friday, 26 April 2024 at 08:32 PM

Javascript View Source Problem (need Help) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Javascript View Source Problem (need Help) (753 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)

What Are The Career Options For CISCO Engineer / I Will Convert PSD To HTML5,CSS3 With Responsive In 72 Hours / Which Approach Is Better For Your Startup – Native, Web And Hybrid?

(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
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.