473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Error with Mozilla with automatic launch.....

Hi all,

I'm currently developping a web app, and this one must be compatible
with IE and Mozilla Firefox. In this webapp, I would like to launch
automatically a anchor link (href) with a javascript script.

My Javascript script works fine with IE but not with Mozilla Firefox.

Here is my script :
<script language="Javascript">
strAppFound = new String("True")
if(strAppFound.toLowerCase()=="true"){
window.lnkApp.click();
}
The error returned by Mozilla Firefox Console Javascript is :
Erreur : window.lnkApp has no properties
Fichier Source : http://localhost/test.aspx
Ligne : 806

The HTML code (href link) is the following, that should be launch
automatically is :

<a class="appLinks"
href="launch.ica?NFuse_Application=Citrix.MPS.App. f10_col.myApplication&NFuse_AppFriendlyNameURLENco ded=myApplication"
target="hiddenwindow" onClick="resetSessionTimeout(); " id="lnkApp"
name="lnkApp">

<img src="icons.aspx?id=EIBHKDOECEIJBMKHEDKFFICKKPGHHAF K"
border="0"
alt="myApplication"
title="myApplication"
align=bottom hspace=3 width="32" height="32"><br>
myApplication<br>
</a>

Everything works fine with IE browser...
Any one have an idea to solve this trouble ?

Thanks

Sep 22 '05 #1
4 2373
au*******@yahoo.fr wrote:
Hi all,

I'm currently developping a web app, and this one must be compatible
with IE and Mozilla Firefox. In this webapp, I would like to launch
automatically a anchor link (href) with a javascript script.

My Javascript script works fine with IE but not with Mozilla Firefox.

Here is my script :
<script language="Javascript">
The language attribute is depreciated, type is required.

<script type="text/javascript">

strAppFound = new String("True")
I'll guess that the point of initialising a string object to some value,
then immediately testing it to see what the value is that this is just a
test harness...

There is no need for string object, you don't seem to need it, a boolean
will do the job:

strAppFound = true;

if(strAppFound.toLowerCase()=="true"){
Having made strAppFound a boolean, you can no do:

if ( strAppFound ) {

window.lnkApp.click();
Here you are using the id of an element as a global variable. That is
an IE-ism and should not be expected to work elsewhere. If you are
writing only for modern browsers (anything after IE 5 or Netscape 4) use:

document.getElementById('lnkApp').click()

It is easy to add support for older IE and Nescape if you want to
support them too (do a search in the newsgroup for document.all and
document.getElementById or poke around the FAQ).

The next issue you have is how widely the click method is supported in
various browsers for the element you have selected. As far as I know,
it's not well supported at all. Firefox will tell you that:

document.getElementById('lnkApp').click() is not a function

Since you know it's a link, get its href attribute and use it to change
the window.location. Replace the above with:

window.location = document.getElementById('lnkApp').href;

}
The error returned by Mozilla Firefox Console Javascript is :
Erreur : window.lnkApp has no properties
Fichier Source : http://localhost/test.aspx
Ligne : 806

The HTML code (href link) is the following, that should be launch
automatically is :

[...]
--
Rob
Sep 22 '05 #2
au*******@yahoo.fr wrote:
Hi all,

I'm currently developping a web app, and this one must be compatible
with IE and Mozilla Firefox. In this webapp, I would like to launch
automatically a anchor link (href) with a javascript script.

My Javascript script works fine with IE but not with Mozilla Firefox.

Here is my script :
<script language="Javascript">
strAppFound = new String("True")
if(strAppFound.toLowerCase()=="true"){
window.lnkApp.click();
}
The error returned by Mozilla Firefox Console Javascript is :
Erreur : window.lnkApp has no properties
Fichier Source : http://localhost/test.aspx
Ligne : 806

The HTML code (href link) is the following, that should be launch
automatically is :

<a class="appLinks"
href="launch.ica?NFuse_Application=Citrix.MPS.App. f10_col.myApplication&NFuse_AppFriendlyNameURLENco ded=myApplication"
target="hiddenwindow" onClick="resetSessionTimeout(); " id="lnkApp"
name="lnkApp">

<img src="icons.aspx?id=EIBHKDOECEIJBMKHEDKFFICKKPGHHAF K"
border="0"
alt="myApplication"
title="myApplication"
align=bottom hspace=3 width="32" height="32"><br>
myApplication<br>
</a>

Everything works fine with IE browser...
Any one have an idea to solve this trouble ?

Thanks


You are counting on the browser creating javascript objects that
reference the elements on the page. IE will create an opbject called
"foo" if there's an element on the page with an ID of "foo". Firefox /
Mozilla will do this too, but only under certain conditions (I don't
know what they are, I think it's only form elements in a form - but
don't quote me on that!).

It's best to assume that those references don't exist and you should
Define and Assign them for any element that you wish to refference.

like this :

Add : var lnkApp = document.getElementById("lnkApp");
and remove the "window." before the call to lnkApp.click();

Hope that helps

Andy

----------------------------------
my javascript notepad
----------------------------------
- http://km0ti0n.blunted.co.uk -
----------------------------------
Sep 22 '05 #3
Hi,

au*******@yahoo.fr wrote:
Hi all,

I'm currently developping a web app, and this one must be compatible
with IE and Mozilla Firefox. In this webapp, I would like to launch
automatically a anchor link (href) with a javascript script.

My Javascript script works fine with IE but not with Mozilla Firefox.

Here is my script :
<script language="Javascript">
strAppFound = new String("True")
if(strAppFound.toLowerCase()=="true"){
window.lnkApp.click();
}


Don't do it this way. Instead,
1.Create a function to open the link in a new window.
2.Then call that function in body "onload".

That way it will work in all browsers i feel.

for mozilla, firefox or IE, try
document.getElementById('lnkApp').click(). Hope it works.

-- Peroli Sivaprakasam

Sep 22 '05 #4
Thank you very much to all of you
window.location = document.getElementById('lnkApp').href; WORKS ! ;)

Sep 22 '05 #5

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

Similar topics

4
by: Jay Davis | last post by:
I can launch a browser on linux with the webbrowser module and the .open() method. However, I want to be able also to control the browser, specifically, I'd like to be able to go to a URL and...
7
by: Paul | last post by:
I thought this is more of an IE issue but i've had no joy on that group perhaps somebody here will have a clue. If i click a link to a web page embedded in Excel (97 OR 2000) i get the standard...
2
by: Peter | last post by:
Hello, First of all, sorry for all the code. I don't know how to explain my problem without it. I have a javascript function which can build a webpage dynamically. A striped down version of...
28
by: joe | last post by:
I have a simple .NET application with two or three listViews which are filled with icons and when the user click on the proper item, they display the related images. I use "image = null ; " for all...
67
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. ...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
4
by: Maileen | last post by:
Hi, I did a VB.NET application but i don't want to deliver the .NET framework to each of my users. Instead of this, i just would like to do a big try and catch and in case of an error is...
12
by: Griff | last post by:
I have a two tier system. I've created a COM+ package on the data tier (Win2003) and exported it as a COM+proxy (v 1.0 compliant) and installed this onto a Win2000 web application. I've...
6
by: p175 | last post by:
2006-08-14-17.46.13.656000-240 I1472H436 LEVEL: Warning PID : 1452 TID : 336 PROC : db2syscs.exe INSTANCE: DB2 NODE : 000 DB : SQ4V6...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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...
0
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,...

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.