English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to make it this code take the user to a link when they click ok. Also what do I use to insert a
in the message?

Here is the code.


onClick="f=prompt('What is your name?','Type Your First Name Here');
alert('hello '+f+' here there will be some text and I need to insert a line break somewhere here, also when the user clicks ok it takes them to http://www.mysite.')">


Thanks

2007-01-30 18:33:42 · 3 answers · asked by bts_22 1 in Computers & Internet Programming & Design

Ok never mind about the
it is correct to use "\n" I was using "/n" instead. But I still don't know what to add to this code to make it open a url onclick when the user clicks ok. Please help

2007-01-30 19:09:50 · update #1

3 answers

I would think it would be easier to create a function first.



I'm not 100% sure, but I would think you could also add your prompt() statement could be included above.






OR:

I normally don't write more than one java statement on html code, like you did, without using a function. But I suppose it that works for you, then you're only missing one line of code.

After the alert box pops up, the page will "freeze" until OK is clicked. Simply add this to the end of what you already have:

location.href="somepage.html";

or
location.href="http://domain.com/somepage.html";

both will work.

2007-01-30 22:22:58 · answer #1 · answered by SharpGuy 6 · 0 0

there is not any code in the international that could thoroughly a hundred% avert hacking. There are coding languages that are safer than others. straightforward HTML is and continually would be hackable. additionally, there's a constrained quantity you're able to do with straightforward HTML.

2016-11-23 16:47:05 · answer #2 · answered by Anonymous · 0 0

with \n inside the text works in firefox.
sorry I'm use linux therefore i don't use explorer

sorry again I'm not speak english

2007-01-30 18:56:16 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers