Author |
Topic |
jrbp
New Member
USA
63 Posts |
Posted - 12 September 2003 : 22:30:12
|
I am trying to make a popup creator using javascript but i can't seem to get it to work. I have asked a couple of people but they arn't good with javascript. i was wondering if anyone can tell me what is wrong with it. thank you.
Forgot to post the url: Jr.marlintinicharters.com/popupmaker.html |
Josh Roy
Midtown Madness 2 Department of Motor Vehicals My Forum |
Edited by - jrbp on 13 September 2003 08:38:58 |
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 12 September 2003 : 23:38:31
|
you might want to post the source code of the one you are having problems with. I also strongly recommend using a popup window that auto-centers. you can download one here and it is super easy to configure:
http://www.dynamicdrive.com/dynamicindex8/autocenter.htm |
|
|
|
Jeepaholic
Average Member
USA
697 Posts |
|
jrbp
New Member
USA
63 Posts |
Posted - 13 September 2003 : 08:34:53
|
oh im sorry i thought i posted the url, its jr.marlintinicharters.com/popupmaker.html
Its a simple page that allows users to put in the dimensions, the url and some other things that they want and it will make the code for the popup.
Thanks |
Josh Roy
Midtown Madness 2 Department of Motor Vehicals My Forum |
Edited by - jrbp on 13 September 2003 08:37:52 |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 September 2003 : 08:40:53
|
well, the first problem is that you have this line of javascript:
document.write("<pre>Place this where you want the link to be on your web page:
you haven't ended the line. You need a " and a ;
and then the next line is html inside a script tag. you'll get an error on that too. i assume you meant to make it:
document.write("your line goes here"); |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
Edited by - Nikkol on 13 September 2003 08:42:42 |
|
|
jrbp
New Member
USA
63 Posts |
|
jrbp
New Member
USA
63 Posts |
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 September 2003 : 10:17:52
|
This is your code. The parts in red are parts that will generate errors due to incorrect syntax. In addition, in the lines that you are trying to write, you have several places where you aren't delimiting double quotes correctly and some missing double quotes as well. Also, I don't think you can write to the page like that after the pages has already been generated. Instead, you could consider writing the value inside a textarea.
<script language="javascript">
Function popup() ;
// Created By Josh Roy JR Business Publications http://jr.marlintinicharters.com
// (c) 2003 JR Business Publications
popname = document.popup.popname.value ;
length = document.popup.length.value ;
width = document.popup.width.value ;
url = document.popup.url.value ;
linkname = document.popup.linkname.value ;
{
document.write("<pre>Place this where you want the link to be on your web page:
<a href=" + url + " onclick="NewWin=window.open('" + url + "','" + popname + "','toolbar=no','status=no','width=" + width + "','height=" + height + "')"> + linkname + </a></pre>")
}
</script> |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
jrbp
New Member
USA
63 Posts |
|
jrbp
New Member
USA
63 Posts |
|
Nikkol
Forum Moderator
USA
6907 Posts |
|
jrbp
New Member
USA
63 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 13 September 2003 : 13:23:04
|
quote: Originally posted by Nikkol
YOUR script (the one that writes the code for a popup) can go anywhere on the page.
well, not anywhere... he's trying to put it between the <textarea> tags and have it execute, which it will not do this way.
I'm a tad bit confused as to the purpose of this project. What are you trying to accomplish Josh? |
|
|
|
jrbp
New Member
USA
63 Posts |
Posted - 13 September 2003 : 13:53:42
|
I am trying to make a popup creator for my users but i can't get it to work, all i know is java script. I have the popup creator made but it wont work i am asking you guys if you can tell me why, Nikkol is the biggest help so far, i have gotten alot of info from him/her.
The url again is jr.marlintinicharters.com/popupmaker.html
I was just wondering if someone could give the answer to my problem.
Does this clarify the task i have?
Thank you, Josh |
Josh Roy
Midtown Madness 2 Department of Motor Vehicals My Forum |
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
Topic |
|