473,738 Members | 10,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Javas cript">
strAppFound = new String("True")
if(strAppFound. toLowerCase()== "true"){
window.lnkApp.c lick();
}
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.ic a?NFuse_Applica tion=Citrix.MPS .App.f10_col.my Application&NFu se_AppFriendlyN ameURLENcoded=m yApplication"
target="hiddenw indow" onClick="resetS essionTimeout() ; " id="lnkApp"
name="lnkApp">

<img src="icons.aspx ?id=EIBHKDOECEI JBMKHEDKFFICKKP GHHAFK"
border="0"
alt="myApplicat ion"
title="myApplic ation"
align=bottom hspace=3 width="32" height="32"><br >
myApplication<b r>
</a>

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

Thanks

Sep 22 '05 #1
4 2395
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="Javas cript">
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.c lick();
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.getEle mentById('lnkAp p').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.getEle mentById 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.getEle mentById('lnkAp p').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.getEle mentById('lnkAp p').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="Javas cript">
strAppFound = new String("True")
if(strAppFound. toLowerCase()== "true"){
window.lnkApp.c lick();
}
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.ic a?NFuse_Applica tion=Citrix.MPS .App.f10_col.my Application&NFu se_AppFriendlyN ameURLENcoded=m yApplication"
target="hiddenw indow" onClick="resetS essionTimeout() ; " id="lnkApp"
name="lnkApp">

<img src="icons.aspx ?id=EIBHKDOECEI JBMKHEDKFFICKKP GHHAFK"
border="0"
alt="myApplicat ion"
title="myApplic ation"
align=bottom hspace=3 width="32" height="32"><br >
myApplication<b r>
</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.getEle mentById("lnkAp p");
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="Javas cript">
strAppFound = new String("True")
if(strAppFound. toLowerCase()== "true"){
window.lnkApp.c lick();
}


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.getEle mentById('lnkAp p').click(). Hope it works.

-- Peroli Sivaprakasam

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

Sep 22 '05 #5

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

Similar topics

4
2792
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 invoke the automatic form filler and post the form, all from within a python script. I have google'd around and I see hints that there are remote controller objects for some browsers, but so far I haven't found any examples of code that controls...
7
3061
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 error page displayed by IE (you know, the 'cannot find server or dns error' page). Turning off 'show friendly http error messages' alleviates this. (Unfortunately this is the Windows default setting!) Whats going on?!?!
2
5996
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 the function looks like this: BEGIN CODE
28
3376
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 images that have been used and are going to be closed. This is how ever no way to reduce the memory consumption. I have noticed , using the task manager, that garbage collector doesn't actually do any collections unless the computer becomes low...
67
4270
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. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
6
4751
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 appreciated. Thanks in advance
4
1175
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 raised due to not presence of .NET Framework, i would like to catch it and display a simple message. Is it possible to do this ?
12
6828
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 created a simple VB6 application that I run on the web tier to call a method on the proxy stub and this successfully runs on the data tier. However, I've attempted to create an ASP page that does exactly the same
6
9636
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 APPHDL : 0-9 APPID: *LOCAL.DB2.060814214011 AUTHID : DB2ADMIN FUNCTION: DB2 UDB, Self tuning memory manager, stmmEnforceMinSizeConstraints, probe:2089 MESSAGE : Unable to find donor to satisfy minSize constraint Does...
0
8969
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
9476
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
9335
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...
0
8210
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
6053
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
4570
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
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2193
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.