473,763 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

popup error (javascript)

I got 2 error from the following code below...
1. I couldn't load up the picture since the picture is at
(C:\company\ima ge\largePic.jpg )
2. I got a page error in my 'index.html' when calling popup(x,x,x) for the
2nd time.

The code are as followed.
Can anyone help please? Thank you very much~~

Ben
~~~~~~~ INDEX.HTML ~~~~~~~~ (c:\company\ima ge\index.html)

<html><head><ti tle>Megatone Inc.</title></head>
<style language='javas cript'>
<!--
function popup(picName, chatWidth, chatHeight) {
popup = window.open('/popup.html','po pup','left=50,t op=50');
var loadedPic = picName;
while(popup.doc ument.readyStat e != "complete") {}
popup.resizeTo( chatWidth,chatH eight);
popup.document. images.src=load edPic;
popup.focus();
};
//-->
</style></head><body>
<A href="javaScrip t:popup('largeP ic.jpg','750',' 392')"><IMG
src="smallPIc.j pg" align=center></A>
</body></html>

~~~~~~~ POPUP.HTML ~~~~~~~~ (c:\)

<html><head><ti tle>Megatone Inc.</title></head>
<BODY marginwidth=0 marginheight=0 leftmargin=0 topmargin=0>

<table width='100%' height='100%' border=0><tr><t d align='center'
valign='center' >
<img name='images' src='' alt='Loading Picture'>
</td></tr></table>

</BODY><HTML>


Jul 20 '05 #1
1 6509
"Ben Wan" <bw******@roger s.com> writes:
<style language='javas cript'>
<style type="text/javascript">

The type attribute is required in HTML 4.
<!--
HTML comments are not needed in Javascript.
function popup(picName, chatWidth, chatHeight) {
Your global function is called "popup" ...
popup = window.open('/popup.html','po pup','left=50,t op=50');
... and here you assign a window to the global variable "popup",
overwriting the function.
var loadedPic = picName;
Why rename the variable? You can just use "picName".
while(popup.doc ument.readyStat e != "complete") {}
Busy-waiting is a bad idea. It takes up ressources and binds the
browser until it finishes (if it does!).

If you insist on waiting until readyState goes "complete" (how many
browsers supports that? Mozilla and Netscape 4 doesn't.)
popup.resizeTo( chatWidth,chatH eight);
popup.document. images.src=load edPic;
Which image? I think you mean
popup.document. images[0].src = picName;
popup.focus();
};
//-->
</style></head><body>
<A href="javaScrip t:popup('largeP ic.jpg','750',' 392')"><IMG
src="smallPIc.j pg" align=center></A>


Don't use the javascript: pseudo protocol.
<URL:http://jibbering.com/faq/#FAQ4_24>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2997
by: Mica Cooper | last post by:
Hi, I have a series of Select menus on a page. I am trying to allow the user to click on the Select title and have it popup a help window. This works fine with the following code except that all the Select choices are lost. <A HREF="javascript:location='menu.jsp';window.open('menuhelp.jsp?menuID=5','me nuhelp',)">MenuTitle</A> I saw an example of a popup on a website that did not lose the menu choices.
1
1868
by: David | last post by:
Hi, I have a simple page on my freebie account site that opens a popup window running index.asp on another site of mine. The code on the freebie hosted server is below. What I'd like to do is have the freebie hosted page shut down once it's opened up the child window. Any ideas? Thanks David
16
1876
by: Greg G | last post by:
I'm trying to open a popup window and then set some data, but I can't seem to make it work. I'm sure I'm missing something obvious. popwin = document.open('mypop.html', \"external\", \"width=\" + w +\",height=\" + h + \",resizable=no,scrollbars=no,status=yes,location=no,toolbar=no,menubar=no\"); popwin.document.data.user=user; mypop.html has a <form name=data> with an element named "user" in it. Essentially, I want to be able to pop...
13
6265
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related to opening up a popup window in an application I wrote. The error messages are quite diverse: "Object doesn't support this property or method" or "Unspecified error." or "The callee (server ) is not available and disappeared; all connections are...
5
2861
by: Hemanth | last post by:
Hello there, I'm running a script that opens a popup window (which is basically a form with checkboxes and a submit button). When I click the submit button I want to run a PHP script and target the result to main page (I mean, update the parent page). My popup form looks like this: <form name="form1" action="run.php" method="get" target="???">
2
2016
by: Kiyomi | last post by:
Hello, I have some codes under event ButtonSend_Click to check the user input values. This check is complicated enough using different stored procedures. Then according the result of the checks, I would like to display a popup page in which the user can select "OK", "Cancel" etc.
0
2016
by: GV | last post by:
Hi all, New to developing in VS 2005 ASP 2.0 Trying to have a easy pop calender for a button on a web page. I keep getting a error message in IE6 that says: Line 69 Char 3 Error: 'this.container' is null or not an object
11
1935
by: Patricio | last post by:
Hello all I open a PopUp that receives two variables (values). This PopUp must return a value as well. How can I retrieve this value? Thanks a lot.
3
7368
by: Jimmy | last post by:
It is also possible for popup window to call function in main window by using the opener property. Will "opener.someFunctionInMain(param1, param2)" in the popup window work? It's possible for main window to call function in the popup window, right? The following is a sample code (close popup window causes to show alert window) which doesn't seems to work. Can anyone see the problem? // main
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.