Jump to content

questions


ownage
 Share

Recommended Posts

question 1 :okay i wrote a bunch of stuff but for some reason it didnt send.. any way i got chooseme to run with mouseover which would trigger a text message and an alert box, but if i have onclose="choseme()" in the body it wont work, i actually want choose me to open another function depending on what the pword was. i dont think it can do this much calculating on close =(. any suggestiongs?question 2also is there a way to get value into a variable from a form, i mucked around with no success

<form><input type="text" width="10" name="bob"><input type="button" onclick="" value="submit"></form>

tried using onclick to make a=value and a=input and a=bob and all this other stuff, im geussing i might have to use a method in the form tag or somethingquestion3i know this is easily done in the body by:

 while(a<100){document.write(a)a++}

but can u do it in a functon, i used this as the function,

function matha(k){k=0;while(k!="5000000"){k++;document.write(k);return k}}

and this in the body in js tages,

while(k<500){document.write(k)

but all i got was 0 then 10 10 10 10 amillion times, is there any way to trigger that function to document.write with an event or any other possible way, ithough my way would work becuase every time it loops the function returns k with being updated by ++, any way if that did work that isnt really a quiker option}question 4also im just curios, how would u make a window.open urself?

Link to comment
Share on other sites

question 1 : I'm not aware of a "close" event in the HTML DOM. Are you thinking about the "unload" event?question 2: Yes, you can use the HTML DOM. Using your form as an example, if you give your text input an id of "bob", you can access its value like this:

var bob = document.getElementById("bob").value;

question3: To call a function from the body, you could do it like this:

<script type="text/javascript">function a(){	a = 0;	while(a < 100)	{		document.write(a++);	}}</script></head><body><script type="text/javascript">a();</script>

question 4: Skemcin has a window.open function listed here: http://w3schools.invisionzone.com/index.php?showtopic=9500

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...