|
We use javascript on our website to open a separate help window. Is there a way we can programmatically close that window (assuming I'd need to use javascript for it).
So, here's how it will go:
Page1.html uses javascript to open a new window
Page2.html will need to close that new window
-- modified at 14:47 Friday 17th November, 2006
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thought I had the answer, until you modified the post.
In the same page, you'd do:
my_window = window.open( ... );
then close it with
my_window.close();
Now, how to do it from another page.....
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I work with IE only so don't know about other browsers.
Page2 would have to have a way of referencing page1. Does it? If so cross page scripting is the same as cross frame scripting.
led mike
|
|
|
|
|
|
Take a look at this lame hack I wrote. Works, but if you click close when the popup window isn't open, it briefly flashes on the taskbar, and in FF the window isn't completely off the screen. Inject the same code into page1 and page2, and give it a shot.
<html>
<head>
<script type="text/javascript">
function open_help_window()
{
window.open("","my_help_window","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=400, height=400")
}
function close_help_window()
{
// if the window already exists, window.open will give us a reference to it
// otherwise a new window is created off the screen and immediately closed
// attempt to position window off the screen (not quite in FF)
var x = screen.width + 100;
var y = screen.height + 100;
var win = window.open("","my_help_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=yes, width=1, height=1, screenX=" + x + ", screenY=" + y + ", left=" + x + ", top=" + y);
if ( win )
win.close();
}
</script>
</head>
<body>
<form>
<input type="button" value="Open Help" onclick="open_help_window()">
<br>
<input type="button" value="Close Help" onclick="close_help_window()">
</form>
</body>
</html>
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I'm not a JavaScript guru, I'm more server side orientated, but I think that you should be able to reference the pop up via its name as long as you are doing it from the same domain as you launched the popup from.
Here is my example:
PAGE 1:
<<SCRIPT LANGUAGE="javascript"><br />
<!--<br />
<br />
function open_window(){<br />
<br />
window.open ('popup_page.html', 'POPUP', config='height=100,<br />
width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,<br />
location=no, directories=no, status=no')<br />
}<br />
--><br />
</SCRIPT>
PAGE 2:
<<hr />
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley</div>
|
|
|
|
|
please help onclick event of a button i have to enter a text in some label that i have already placed on the form. I have made a function in the script tag and I am calling this function on the click event of the button but it says label1 not defined. All this should be in HTML/XML format. I know this is very easy, I can do the same thing through ASP.net but I want to do that by inserting in the HTML tags of the button. please help.
function lab1()
{
label1.text="Nakul"
}
I am calling this funtion:
Nakul
|
|
|
|
|
Javascript, being client-side, does not recognise the server-side "text" property of your label, nor even know it is a label - take a look at the page source as rendered in the browser to see how your page is rendered...
try replacing the javascript line with this instead:
document.getElementById("Label1").innerHTML="Nakul";
cheers
Fred
|
|
|
|
|
JavaScript and ASP.net are 2 very different languages. If you plan to use JavaScript then maybe you should do some research in the specifics of that language.
The above suggestion shows what the correct format for the what you intend to do is.
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
Does anyone have a full example on how it works? Specifically, I'm looking for ways to get whole sentences and highlighted column data if possible (startrow to endcolumn). The MSDN mentioned the following keywords, but Googling for these came up sort of empty (except for word). Thanks.
Member name Description
wdCell A cell.
wdCharacter A character.
wdCharacterFormatting Character formatting.
wdColumn A column.
wdItem The selected item.
wdLine A line.
wdParagraph A paragraph.
wdParagraphFormatting Paragraph formatting.
wdRow A row.
wdScreen The screen dimensions.
wdSection A section.
wdSentence A sentence.
wdStory A story.
wdTable A table.
wdWindow A window.
wdWord A word.
"This perpetual motion machine she made is a joke. It just keeps going faster and faster. Lisa, get in here! In this house, we obey the laws of thermodynamics!" - Homer Simpson
Web - Blog - RSS - Math - LinkedIn - BM
|
|
|
|
|
hi all, this is my javascript code. var1 goes in as string so i turn it to number. this code returns always 10! i cannot find anything why it's happening.. thanks for help...
function foo(var1, var2)
{
var1 = new Number(var1);
switch(var1)
{
case 1:
return 1;
break;
case 2:
return foo2(var2);
break;
default:
return 10;
}
}
svs
|
|
|
|
|
This seems to be a problem with the language itself not with the switch.
Try using:
var1 = new Number(var1)- 0;
Ernesto Tejeda
|
|
|
|
|
You are creating a Number object, which is not the same as a number value.
Try:
var1 = Number(var1);
or
var1 = parseInt(var1);
---
b { font-weight: normal; }
|
|
|
|
|
thanks for helping both of you guys.. parseInt looks familiar
|
|
|
|
|
Hi all,
I've just updated my website and am looking for anyone who fancies taking a look at it and giving me some constructive criticism. I know some of you have helped me before with beta testing (thanks for that), any comments would be great.
Oh yes, the link... it's here[^]!
Cheers
Andy
-- modified at 10:46 Friday 17th November, 2006
|
|
|
|
|
what's is the postfix "ashx" means?
=========================================
中国,昆明
|
|
|
|
|
It's an extension used by ASP.NET for HTTP handling (the file doesn't actually exist). I use it with Maverick.Net to implement an MVC architecture. You can see details of Maverick here[^].
|
|
|
|
|
|
You should indiquate Edward Caldwell position/occupation. I could find out who he is by googling but there might be other ignorant people who might reluctant to try and find out.
___________________________________________________________
On the whole human beings want to be good, but not to good and not quite all the time - George Orwell
|
|
|
|
|
Sorry mate, but the green and white menubar is pretty hard to read. The white doesn't contrast too well with the green.
The site is also heavily table dependent - making it hard for a screen reader to use. The font's don't resize - thus failing one of the disability accessibility tests here in the UK. Have you considered registering your site with SiteMorse and running the tests there. I do this for a lot of my clients, and it does pay them dividends with complying with UK legislation (especially as we have clients who are, shall we say, more governmental based).
Don't take this too hard. On the whole, I like the look of the site and it looks like you have a great product to sell. Good luck with it.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, I'll take a look at this.
|
|
|
|
|
And just a small thing, but as you move your mouse over the menu bar (causing dropdown menus to appear), the previous dropdowns take a while to disappear.
|
|
|
|
|
Looking at it using Mozilla Firefox 2 it seems fine, dropdown menu appears quickly. There is only a slight delay when you move to the next top menu as the previous drop down still remains for a second. Colours look great.
I am the handsome one in the crowd.
|
|
|
|
|
Just a small one - under the Company tab, you have an item "Refunds"....sends a really negative message IMHO. Since the page is also about a money back guarantee, why not something like "Satisfaction Guarantee"
Probably nothing, just my 2c
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I believe the usage of tables and div elements to format your page is going against the current trend of design and is definitely non-standard. For example, td elements should never contain div elements, and the menu bar could be expressed as an unordered list.
You can get some design ideas from:
http://www.alistapart.com/[^]
and
http://www.csszengarden.com/[^]
to get your design near to the standard.
-- modified at 20:57 Saturday 18th November, 2006
|
|
|
|