JS for Mozilla

S

sni.ukr

Hi guys!!!
Some problem with Mozilla
For example:

function changeLinksProperties( containerId ) {

var buttonsPlace = Global.getObject('adminButtonsPlace');
var confirmMessage = "('Do you want to delete this item?');"
var confirmFunction = "onclick="+"""+"return
confirm"+confirmMessage+"""
var imgSize = "width='12' height='13'";
var imgOnError =
"onerror='this.style.visibility=\"hidden\";this.parentNode.innerHTML=this.alt'";
var myArray = [
{
className: "comAddURL",
title: BaseMessages.addLinkTitle,
innerHTML: "&nbsp;<img src='/images/beheer_nieuw.gif'
alt='"+BaseMessages.addLinkTitle+"' " + imgSize + imgOnError + " />"
},{
className: "comDeleteURL",
title: BaseMessages.deleteLinkTitle,
innerHTML: "&nbsp;<img src='/images/beheer_verwijder.gif'
alt='"+BaseMessages.deleteLinkTitle+"' " + imgSize + imgOnError + "
/>",

onclick: function() {

// return false;
alert("!!!!!!!!!!!!!!");
if(!window.confirm( "Do you want to delete this item?" ) ) {
return false;
}


}
....
*************************************************************************************************

onclick: function() {

// return false;
alert("!!!!!!!!!!!!!!");
if(!window.confirm( "Do you want to delete this item?" ) ) {
return false;
}
this parameter working in IE
But in Mozilla doesn't work.

Pls write me some your idea for it...
 
R

RobG

Hi guys!!!
Some problem with Mozilla
For example:

function changeLinksProperties( containerId ) {

var buttonsPlace = Global.getObject('adminButtonsPlace');

Where is 'Global' defined? Where is its getObject method defined?

var confirmMessage = "('Do you want to delete this item?');"
var confirmFunction = "onclick="+"&quot;"+"return
confirm"+confirmMessage+"&quot;"

Allowing auto-wrapping nearly always introduces errors and makes helping
you that much more difficult.

Post a minimal example that works in IE but not in Mozilla. Posting
incomplete snippets without any of the supporting HTML, description of
what it should do or the error or error messages makes helping you
nearly impossible.


[...]
onclick: function() {

// return false;
alert("!!!!!!!!!!!!!!");
if(!window.confirm( "Do you want to delete this item?" ) ) {
return false;
}
this parameter working in IE

What parameter?

But in Mozilla doesn't work.

Here is a test that works in IE and Firefox of something like what you
are attempting. Expand it to include whatever is going wrong, don't
include anything that is not directly related to the issue:


<div id="div01">div 01 - click on me</div>
<div id="div02">div 02 - click on me</div>

<script type="text/javascript">

var qTest = [
{
parm : 'I am parm 1',
onclick : function(){
alert(qTest[0].parm);
}
},
{
parm : 'I am parm 2',
onclick : function(){
alert(qTest[1].parm);
}
}
]

document.getElementById('div01').onclick = qTest[0].onclick;
document.getElementById('div02').onclick = qTest[1].onclick;

</script>
 
S

sni.ukr

Basic problem:
for Mozilla js construction :
******************************
var myArray = [
{
className: "comDeleteURL",
title: BaseMessages.deleteLinkTitle,
innerHTML: "&nbsp;<img src='/images/beheer_verwijder.gif'
alt='"+BaseMessages.deleteLinkTitle+"' " + imgSize + imgOnError + "
/>",
onclick: function() {
if(!window.confirm( "Do you want to delete this item?" ) ) {
return false;
}
}
**************************

doesn't work (in IE normally)

in html template it calling : <a href="{deleteURL}"
class="comDeleteURL">

so, I tried your variant
var qTest = [
{
parm : 'I am parm 1',
onclick : function(){
alert(qTest[0].parm);
}
}
]

But this is also incorrect for Mozilla

your comment?
 
T

Thomas 'PointedEars' Lahn

Basic problem:
for Mozilla js construction :

"js construction"?
******************************
var myArray = [ ^
^
className: "comDeleteURL",
title: BaseMessages.deleteLinkTitle,
innerHTML: "&nbsp;<img src='/images/beheer_verwijder.gif'
alt='"+BaseMessages.deleteLinkTitle+"' " + imgSize + imgOnError + "
/>",
onclick: function() { ^
if(!window.confirm( "Do you want to delete this item?" ) ) { ^
return false;
} ^
^
**************************

doesn't work (in IE normally)

The outer Array literal and inner Object literal were not closed properly
with `]' and `}', respectively; it cannot work. Whatever "to work" refers
to here.
in html template it calling : <a href="{deleteURL}"
class="comDeleteURL">

Templates are not relevant. When it is about client-side programming, post
the output that is generated, not what is used to generate that output.
so, I tried your variant
var qTest = [
{
parm : 'I am parm 1',
onclick : function(){
alert(qTest[0].parm);
}
}
]

But this is also incorrect for Mozilla

It is syntactically correct, but it does not make much sense. There is
an Object object initialized with literal notation being the first and
only element of an Array object initialized with literal notation.
your comment?

"Does not work" is a useless error description. [psf 4.11]

<URL:http://jibbering.com/faq/#FAQ4_43>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top