473,594 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Safari cannot created variable dynamically?

I have the following code to open a popup window and pass a value.

In the main html page:

var w = window.open("po pup.htm","","wi dth=510,height= 450");
w.itemIndex = 100; // alert(w.itemInd ex) will show 100

The popup window will be openned. However,
in the popup.htm, javascript code

alert(this.item Index) shows 'undefined', while it shows right value (100 in
this example) in Firefox, IE.

How to pass value when using Safari?

Thanks.
Jul 23 '05 #1
4 1222


nick wrote:
I have the following code to open a popup window and pass a value.

In the main html page:

var w = window.open("po pup.htm","","wi dth=510,height= 450");
w.itemIndex = 100; // alert(w.itemInd ex) will show 100

The popup window will be openned. However,
in the popup.htm, javascript code

alert(this.item Index) shows 'undefined', while it shows right value (100 in
this example) in Firefox, IE.


What does Safari show for
window.itemInde x
?
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
All this.itemIndex, itemIndex, window.itemInde x shows "undefined" .

"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:42******** *************** @newsread2.arco r-online.net...


nick wrote:
I have the following code to open a popup window and pass a value.

In the main html page:

var w = window.open("po pup.htm","","wi dth=510,height= 450");
w.itemIndex = 100; // alert(w.itemInd ex) will show 100

The popup window will be openned. However,
in the popup.htm, javascript code

alert(this.item Index) shows 'undefined', while it shows right value (100
in this example) in Firefox, IE.


What does Safari show for
window.itemInde x
?
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3
"nick" <nb************ **@hotmail.com> skrev i meddelandet
news:cu******** **@news3.bu.edu ...
I have the following code to open a popup window and pass a value.

In the main html page:

var w = window.open("po pup.htm","","wi dth=510,height= 450");
w.itemIndex = 100; // alert(w.itemInd ex) will show 100

The popup window will be openned. However,
in the popup.htm, javascript code

alert(this.item Index) shows 'undefined', while it shows right value (100 in this example) in Firefox, IE.

How to pass value when using Safari?

Thanks.


Perhaps popup.htm renders its content before w.itemIndex is defined?

--
Joakim Braun
Jul 23 '05 #4
Not likely, I added alert(itemIndex ) in the function called by onload and it
still shows undefined on Safari.
w.itemIndex should create a public member itemIndex of the object window.

"Joakim Braun" <jo**********@j fbraun.removeth is.com> wrote in message
news:zm******** ***********@nnt pserver.swip.ne t...
"nick" <nb************ **@hotmail.com> skrev i meddelandet
news:cu******** **@news3.bu.edu ...
I have the following code to open a popup window and pass a value.

In the main html page:

var w = window.open("po pup.htm","","wi dth=510,height= 450");
w.itemIndex = 100; // alert(w.itemInd ex) will show 100

The popup window will be openned. However,
in the popup.htm, javascript code

alert(this.item Index) shows 'undefined', while it shows right value (100

in
this example) in Firefox, IE.

How to pass value when using Safari?

Thanks.


Perhaps popup.htm renders its content before w.itemIndex is defined?

--
Joakim Braun

Jul 23 '05 #5

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

Similar topics

4
2243
by: MPennig | last post by:
Here's my situation. I have a function defined in my document's <head> section which adds a <script> tag to a specified <div> tag. The added <script> has a src="" attribute pointing to a PHP file, which dynamically returns JavaScript. In Safari, the src file isn't downloaded. Neither is any code contained within the new script tag . In IE(6) and Firefox, this works as expected. Here's my code. I hope it will better illustrate what I'm...
8
5460
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
2
2914
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have a WebForm with some textboxes, dropdownlists, a panel, imagebutton and so on. When I click on the image button (which was created at design time) I dynamically build a table. In each of row of that new table I put several cells and one cell...
3
6678
by: Joe Cox | last post by:
I am having a problem with style properties for dynamic images in Mac OS X Safari. By dymanic images, I mean images allocated with the javascript 'new Image()' call. With static images (created with the html <img> tag), I can make the image visible or not, i.e. '<img style="visibility='hidden'" src='xxxx'/>'. But if I create the image dynamically with javascript: new Image() then try to modify the style, Safari chokes, and the Debug...
34
3821
by: Simon Wigzell | last post by:
document...focus() will scroll the form to move the specified text field into view on everything I have tried it with except Safari on the MAC. The form doesn't move. Any work around? Thanks.
8
1670
by: dd | last post by:
Hi, I've discovered a scenario where Safari 1.3 (I need to make my stuff compliant with 1.3+) gets confused about the scope of local variables WITHIN functions that were created in dynamic script blocks. I've made this example where function def has a local i variable in a loop, and it calls function abc which also has a local i variable in a loop. What happens is that Safari is not respecting the scope and is allowing the called...
2
1642
by: Nathan Sokalski | last post by:
I have LinkButtons that are dynamically created in one of the PostBack events. They must be created in the PostBack event because one of the variables required to determine which ones to create comes from the event arguments. Because the LinkButtons are not created in the Init event, they will not exist when I click them to perform a postback. How do I handle the events for these LinkButtons? I appreciate any help you can give. Thanks. --...
15
2643
by: GinnTech | last post by:
I have a site that works perfectly in IE6 IE7 FF2 FF3 but not in the latest Safari. Here is the issue. I am attempting to call functions within a flash object. When trying to attempt to retrieve the object to call the functions IE6 IE7 FF2 FF3 all return Objects to work with. In Safari a function is returned. Here is the code. /
0
8251
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8372
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
8003
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
8234
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6654
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...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5408
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
3859
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.