Results 1 to 10 of 11
-
4th Mar 2012, 10:43 AM #1OPMemberWebsite's:
eih.bz pornDDL.me sexytattoochicks.tumblr.comJavaScript easy help needed
Hey guys,
I need some JS help, I dunno why it doesn't work tbh :/
It's something simple..
Here is the code
PHP Code:<script language="javascript" type="text/javascript" >
<!--
function optellen(a,b)
{
var res = parseInt(a) + parseInt(b);
return res;
}
var getal1 = prompt("Type eerste getal in");
var getal2 = prompt("Type tweede getal in");
var uitkomst = optellen(getal1, getal2);
document.write(getal1 + " plus " + getal2 " = " + uitkomst);
-->
</script>
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<link rel="SHORTCUT ICON" href="sun.png" type="image/x-icon" />
<title> TROLOLOLOLO </title>
<link href="style.css" rel="stylesheet" type="text/css" />
<!-- JAVASCRIPT hoofdstuk 4-->
<script language="javascript" type="text/javascript" src="code.js"></script>
<script language="javascript" type="text/javascript" >
<!--
function optellen(a,b)
{
var res = parseInt(a) + parseInt(b);
return res;
}
var getal1 = prompt("Type eerste getal in");
var getal2 = prompt("Type tweede getal in");
var uitkomst = optellen(getal1, getal2);
document.write(getal1 + " plus " + getal2 " = " + uitkomst);
-->
</script>
<!-- JAVASCRIPT -->
</head>
Any help appreciated
Cheerspi0tr3k Reviewed by pi0tr3k on . JavaScript easy help needed Hey guys, I need some JS help, I dunno why it doesn't work tbh :/ It's something simple.. Here is the code <script language="javascript" type="text/javascript" > <!-- function optellen(a,b) { Rating: 5
-
4th Mar 2012, 10:46 AM #2I r Super Cop
forgot to close the html tag?
Follow besthostingforums on FB
Looking for an Article Writer? Check out my services here.
-
4th Mar 2012, 10:47 AM #3OPMemberWebsite's:
eih.bz pornDDL.me sexytattoochicks.tumblr.comNo no mate, it's all OK I only posted the <head> section here
Anyways, here is the whole page:
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<link rel="SHORTCUT ICON" href="sun.png" type="image/x-icon" />
<title> TROLOLOLOLO </title>
<link href="style.css" rel="stylesheet" type="text/css" />
<!-- JAVASCRIPT hoofdstuk 4-->
<script language="javascript" type="text/javascript" src="code.js"></script>
<script language="javascript" type="text/javascript" >
<!--
function optellen(a,b)
{
var res = parseInt(a) + parseInt(b);
return res;
}
var getal1 = prompt("Type eerste getal in");
var getal2 = prompt("Type tweede getal in");
var uitkomst = optellen(getal1, getal2);
document.write(getal1 + " plus " + getal2 " = " + uitkomst);
-->
</script>
<!-- JAVASCRIPT -->
</head>
<body>
<center>
<a href="#down"><img src="down.png" /></a>
<a id="top"></a>
<h1> MINGA </h1>
<img src="http://s1.eih.bz/images/photo1.gif" height="250px" width="250px" />
<h2> Kleinere minga </h2>
<h3> Blah </h3>
<p><span>
<font color="#FF0000"> ben ik rood? ow yeah</font>
<br>
sdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv ssdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv s<br />
sdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv ssdf:gnsdfklgnsdfgn lkdfsgl dsfngkl jdfnbknxcklvn wxcbknv s<br /></span></p>
<em>helllo em tag </em>
mother of God<br />
<h1> <a href="lists.html" >Lists</a> </h1></br>
<h1> <a href="images.html" >Images</a> </h1></br>
<h1> <a href="tables.html" >Tables</a> </h1></br>
<a href="javascript:popup();">Alert popup JavaScript<a> <br />
<a href="javascript:pr0mpt();">Prompt popup JavaScript<a> <br />
<a href="javascript:pr0mpt2();">Prompt 2 popup JavaScript<a> <br />
<a href="javascript:optellen();">Prompt 2 getallen optellen<a> <br />
<a href="koppeling.html" > Ga terug zeimer </a><br />
<a href="koppeling.html" > Ga terug zeimer </a><br />
<a href="koppeling.html" > Ga terug zeimer </a><br />
<a href="koppeling.html" > Ga terug zeimer </a><br />
<a href="koppeling.html" > Ga terug zeimer </a><br />
<a href="koppeling.html" > Ga terug zeimer </a><br />
<a href="#top"><img src="up.png" /></a><br />
<a href="koppeling.html#down">Down</a>
<a id="down"></a>
</center>
</body>
</html>
-
4th Mar 2012, 10:59 AM #4MemberWebsite's:
sborg.usYou missed a plus sign before " = " in document.write
V3g3ta | Halcyon | Abhi
-
4th Mar 2012, 11:09 AM #5OPMemberWebsite's:
eih.bz pornDDL.me sexytattoochicks.tumblr.comOMG
Thanks a lot
---------- Post added at 12:09 PM ---------- Previous post was at 12:02 PM ----------
One more little question, the script starts everytime I refresh the page.
I've also added a link to make it work, but it returns "NaN" when I click it:
<a href="javascript:optellen();">Prompt 2 getallen optellen</a> <br />
-
4th Mar 2012, 11:14 AM #6MemberWebsite's:
sborg.usLol, it says "null plus null = NaN" on top if I simply press OK
Do a proper checking of what input the user provides.
V3g3ta | Halcyon | Abhi
-
4th Mar 2012, 11:15 AM #7MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comyou must make a new function
Code:function optellen(a,b) { var res = parseInt(a) + parseInt(b); return res; } function getoptellen() { var getal1 = prompt("Type eerste getal in"); var getal2 = prompt("Type tweede getal in"); var uitkomst = optellen(getal1, getal2); document.write(getal1 + " plus " + getal2 + " = " + uitkomst); }
and call it
Code:<a href="javascript:getoptellen();">Prompt 2 getallen optellen</a> <br />
-
4th Mar 2012, 11:30 AM #8
-
4th Mar 2012, 11:41 AM #9MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comi typed the function name wrong, check now
-
4th Mar 2012, 11:43 AM #10MemberWebsite's:
forumhookers.comWhether you need help in this?
Or it is fixed? Let me know through pm!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Hiring] jquery javascript popup needed
By tractor3231 in forum Completed TransactionsReplies: 0Last Post: 8th Aug 2011, 03:51 PM -
Easy-Share Preimum Needed
By BeboHeart in forum General DiscussionReplies: 7Last Post: 30th Jun 2011, 03:07 PM -
[Hiring] GFX Needed ( Small Easy Job )
By Crossy in forum Completed TransactionsReplies: 3Last Post: 18th Mar 2011, 07:55 PM -
Javascript help needed
By Storm in forum Technical Help Desk SupportReplies: 1Last Post: 6th Jan 2010, 10:45 PM -
HotFile-Uploading-Easy-share Premium accounts needed!! exchange of Rapidshare account
By RexY in forum Completed TransactionsReplies: 12Last Post: 19th Jul 2009, 08:06 AM
themaCreator - create posts from...
Version 3.20 released. Open older version (or...