Are you just trying to open up a new window when something is pressed? Why not try the TARGET="_BLANK" method (insert this in your "A HREF" tag)?
Or the following method:
<script language="javascript">
<!--
function popupNewWindow(page) {
window.open(page, "AddTask", "width=570,height=560,location=no,scrollbars=yes,menubars=yes");
}
-->
</script>
<a href="javascript:popupNewWindow('somepage.htm')">Click insert new</a>
Not sure if this is what you want.
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
I think Dan means target="_blank" and not alt= :)
cscgal
The Queen of DaniWeb
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
Yes! Sorry for the f-up. Also, Dani, is there something you can do about the horrible parsing job the code tags do? It's putting unnecessary spacing between code. Look at the code I posted before, where it says "NewWindow" - there's a spacing there.
samaru
a.k.a inscissor
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
top.window.location="mail.html";
no?
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Does other javascript code work in the external file, within the page. (for example, have you tried making a function in the .js file, with nothing more than say, an alert with a message of test, and tried calling it with the page, just to see if the page is importing the external file?)
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Sometimes God's Power is all it takes ;)
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
You can do that anyway. If someone just views source, and then looks at the path to the external file, they can merely stick that in their browser as a URL, and open it or download it. Your Very best bet, is if you have server side access (for example, you can use ASP files, CGI files, PHP, or something along those lines). This way, the password is stored on the server, and never actually sent to the browser. With javascript, EVERYTHING gets sent to the browser, and is readable by it. There are TONS of free verification CGI's and ASP's, PHP's etc, etc. Also, should you need it to be custom built for some reason, let me know, and I can help with that also.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Alright,
Then That seems to be the best way to go for what you are doing (sticking the password in an external JS file). If You need any other help, just let me know.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
and window.location is not working? post me the code, or link me to your site... or both.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
And The: alert("Pravilen vnos!"); works fine right? It just doesn't redirect the site...
something else to consider... instead of using an "onsubmit" with a submit button, consider using a regular button, with an onclick event... that way you don't have to do a "return function();" You could call the function with the button, and then do a document.formname.submit(); in the javascript...... let me know your thoughts.
Also, Have you considered trying "parent.location" (or maybe it's parent.window.location)
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
Thats Awesome! I'm glad it worked!
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215