I have a rather lengthy javascript application that I want to run in it's
own window. It looks like it is no problem to do using the window.open and
document.write commands, however this seems like a lot of extra code to wrap
every line of my javascript with mywindow.document.write(""); Is there
anyway around this or perhaps a different approach to running javascript in
it's own window?
Does anybody know a way to retreive the running timers (their ids) in a html page?
I cannot find something in the html dom at first sight. Is there collection of timers available (like window.all[], forms[], frames[] and such)? Some other way?
When you create a timer (setTimeout), the return value is the timer id. Suppose that some script (which you do not own and cannot change) calls setTimeout but doesn't store the id. How to retreive it, to stop the timer (clearTimeout(id))?
I though to override the "setTimeout" like below, but that doesn't work. Probably since the original setTimeout is used before I declare this new one.
var oldSetTimeout=setTimeout; var timerSaved=0; setTimeout = new function(arg,time) { /*alert('timer: '+arg+', '+time);*/ timerSaved=oldSetTimeout(arg,time); return timerSaved; }
I was debugging my code looking for a loop. So in the process I added a confirm request and if the user clicked cancel I coded location.replace("Kill.html"). Problem was that the JAVASCRIPT continued to run until either it finished or I used the Task Manager to end the session. :( There3 was a small difference in browsers: Firefox put up the new screen while continuing to run the JAVASCRIPT while IE didn't put up the new screen until after the JAVASCRIPT was finished. I could tell the JAVASCRIPT was still running because the confirm messages kept popping up.
I have put some javascript into my html page (using IE6 as browser), however I get the message: "To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options...." Once I have selected that and specified to allow for blocked content ... the javascript runs ok. However I do not have the same problem with loading other webpages (also containing javascript) from the internet!! Does anyone have any ideas?
Another problem I have is that I have opened a popup window, which has a stylesheet linked to it. However it does not seem to know about the stylesheet as my text fonts/ styles are not displayed.
I run multiple IE standalones simultaneously on my PC for CSS testing purposes (see this page for more).
I have discovered that, if you have a version of IE 5 running (tested with 5.0 and 5.5), and, in IE 7, run a popup window script that uses window.open, IE 7 will crash.
Not really a problem - I can always quit the 5.x browsers when I need to test javascript - but thought it was worth passing along.
What happens with Javascript is that, any commands executed in myFirstFunction and mySecondFunction are not applied, displayed, or apparent until myThirdFunction has finished executing. How can I get code to execute asynchronously without relying on subsequent code executing?
i know how to do the link thing that if u click it it closes the window. but im wondering if theres a way to automatically close a window after the php code is done running. cause i have an inbox and theres a link to delete the message if you click on it it will open up a new windows and run the php script to delete the message then it will say message deleted. im wondering how instead if just saying msg deleted it can close itself(the window) as well? does anyone know how? can i do it with pure php or do i need javascript too? i figured javascript.
I would like to have an onClick function that when the object (image that submits a form) is clicked on, it runs a PHP script as well as submitting the form. I can get it to work by opening a new window, but I don't want this to happen as it looks fairly spammy even when you use javascript to immediately close that window after the PHP script has done its bit.
I have a couple of utility windows - a calculator and a calendar that popup from my main window. I would like them to always stay in front of the parent window until they are shut down with there own close buttons. As it is, when you click back to the parent window, of course it comes in front of the child windows. Can I do this?
this function should open a popup showing an image automatically adjusting browser window's height and width. It works fine with IE6 but not with IE7. In IE7 opens popup too small. why ? Code:
Is there any way to have a browser window resize itself when displaying a new HTML page? I'm using the javascript below to open a NEW window at a certain size, but I'd prefer the page to load in the same window, just sized differently. Here's the script I'm currently using:
<script language="JavaScript"> function link () { msgWindow=window.open('http://anylink/index.html','link','border=0,directories=no,height="100%",left=1,location=no,menubar=0,resizable=yes,scrollbars=yes,status=yes,toolbar=no,top=1,width="100%"');} </script>
<a href="javascript: link ()">any link</a>
The situation is: in Win2000 open OK in respect to the width & height referer in script. But on WinXP, this link open on a litle window.
How can I create a popup message window, with a custom message, that asks a yes or no question? If they click yes, it can load another script or a page, if they click no it leaves them where they are? Can someone give me an example?
Please let me know to execute specific javascript code when the browser is exiting. When a browser is closed i want some code to display images or text to be executed.
We've got a CDROM with a Flash Projector movie on it. Within the Flash projector (which is already burned on CDROM...can't change it), we have the typical getURL fuctions to open a Web browser and browse a link. This works fine when there isn't a browser window already open: the link opens in the FOREGROUND, infront of our Flash Projector.
However, now we've got a problem since after we've burned the CDROM, if a user has a Web browser open already, and clicks a link within the Projector, the new window does not come to the front...it simply stays behind the full-screen projector.
So, we've tried putting an onLoad="window.focus;" tag in our BODY tag on the web pages our Project is linking to, and that actually worked at first (the pages are ASP Classic). However, they're not working anymore. We're really not sure why.
When we load that page, quickly flip to another via ALT-TAB, the first page DOES come forward. However, it doesn't seem to come infront of another application. So, if we hit reload for the above page, then quiclkly ALT-TAB to MS Word, the page will not force itself infront of Word.
but did not help much. In Internet Explorer w.document.charset="ISO-8559-2" after w.document.open solved the problem, but with Mozilla this do not work. There is a w.document.characterSet, but this is read only. Mozilla seems forcing UTF-8 - is there a way to change this?
I have a form that I would like to get the values entered on the page and go to a new page in the same window. I can make the code work to open a new window, but I need it to open in the same window. Here is what I have:
Is it possible to send attributes into this function to change the print preferences from Portrait to Landscape with IE 6.0 set as the standard browser? Right now I'm using
javascript:window.print()
as the command.
Clients want it and I want to confirm it's not possible. If I'm using an old, deprecated process, please give me a heads-up. I'm no Javascript genius.
I want to make a capture window in *standalone* (in a *.js file) javascript, much in the same way as the VBscript inputbox() function. I can make it inside a *.html file with the prompt() function.
Or, is there a way to make a window and then work with this window?
I've written a Fax Cover Sheet generator web page for the company I work for. The user inputs all the information into a form and clicks 'print'. I do not know CGI, so i've accomplished the tasking using javascript to generate a pop-up window containing the formatted information from the form. However, no matter what I try, I can't get the browser to print the pop-up box instead of the main window. Can someone help me?
Here is sample code that imitates how the real page works:
I would like to have a page on my site containing links to external URLs. When I click on these links, a new window should open with the new URL and some text formatting javascript (or other language) code be applied to it. This would be like loading a new URL and then apply a bookmarklet to it. But I want to be able to do both in one shot. you click on the link, open a new window, and apply the code to the URL. Also, when you open the new window, the location bar should show the external URL, not mine. It doesn't have to necessarily be done with Javascript.