Mozilla Doesn't Handle Function Pointer Well?
Jul 23, 2005
I have the following code:
var ocevent = function(v)
{
alert('javascript event: u clicked '+v);
return false;
};
var items = {
"002.jpg": {text:"002", href:"#", click:function(){return ocevent(2)} },
"003.jpg": {text:"003", href:"#", click:function(){return ocevent(3)} },
....}
And I use the following code to assign the click property to onclick of
anchor.
a.setAttribute('onclick', items[id].click);
However, the code works well in IE but not in Mozilla Firefox. To test the
code go to:
View 5 Replies
ADVERTISEMENT
Apr 21, 2007
Is there a way of displaying the id of the element under the pointer ?
Please dont ask why I need it, but I do, i found tools that needs
installation that provide the same funcitonality. However, I would
like to turn on this feature using a flag in my url. Something like
debug=1.
View 5 Replies
View Related
Mar 11, 2011
I'm working through the sitepoint ajax book and had a problem with a particular chunk of code. I eventually tracked down the error and it was being caused because I had:
window.onload = Monitor.init();
instead of:
window.onload = Monitor.init;
Now, one of the sticky threads mentioned that the first is a function call and the second is a function pointer. My questions are:What's the difference between a function call and a function pointer? Why did it cause problems in this particular case? What are the general implications/issues with using one over the other?
View 1 Replies
View Related
Apr 25, 2006
I have this code in actionscript that calls javascript:
actionscript:
zoom_in = function () {
var tw1:Tween = new Tween(mc_1, "_width", Regular.easeOut,
mc_1._width, 0, 1, false); //OK
var tw2:Tween = new Tween(mc_1, "_height", Regular.easeOut,
mc_1._height, 0, 1, false); //OK
ExternalInterface.call("zoom");
}
javascript:
function zoom()
{
top.resizeTo(1024, 768);
self.moveTo(0,0);
}
Everything works perfectly on Firefox 1.5 but not on IE 6+
in IE the "zoom" function doesn't work, but if I add an alert it DOES work:
function zoom()
{
alert('this works');
top.resizeTo(1024, 768);
self.moveTo(0,0);
}
View 1 Replies
View Related
Mar 14, 2010
I have got a following function:
PHP Code:
function addEvent(obj, type, fn) {
if (obj.addEventListener)
[code].....
View 4 Replies
View Related
Jul 19, 2011
I am trying to call a deactive_tiptip function from tiptip source code when partial updates happened.I want to call that function inside this code
function pageLoad() {
if (Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
}
[code]....
View 3 Replies
View Related
Feb 16, 2009
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
[Code]...
View 9 Replies
View Related
Jan 20, 2009
I written below javascript function to handle Unicode characters in HTML text boxes.code for & and ' ' goes into infinite loop, is there any better way to achive this ?
function handleSpecialCharacters(){
var text = document.getElementById('Article_Title').value;
var text1 = ""; [code]....
View 2 Replies
View Related
Mar 1, 2010
how to handle a callback of an event, before it performs the default href function.
<code>
<a href = '<?php $url ?>' onclick = myFunction(); return true;>Click Here</a>
</code>
I want the onclick event to finish completing and then perform the default href function, which is denoted by the "return true". The javascript "myFunction()" opens a window in a pop-up and it has a submit button in it. I would like to wait till this page loads in the pop-up window and only after the user clicks on the close button, the default href function needs to be carried out. I cannot figure out on how to get the callback from this event.
View 1 Replies
View Related
Nov 28, 2005
Following function works for IE, but not for Mozilla FF. I am truncating the string to size =20. Also I am using custom attribute att as I have too many tags inside a <td>.
function trunc_dest()
{
var x = document.getElementById('chtbl');
var t = x.getElementsByTagName('tr');
for (var i = 0; i < t.length; i++)
{
var d = t[i].getElementsByTagName('td');
for (var j = 0; j < d.length; j++)
{
if (d[j].att == 'dest')
{
// var e = d[j].innerHTML;
var w_str = unescape(d[j].innerHTML).split('<');
// alert(w_str[0]);
if (parseInt(w_str[0].length) > 20)
{
d[j].innerHTML = w_str[0].substring(0,19)+"...*";
} } } }}
View 2 Replies
View Related
Jul 23, 2005
Everything works fine with Opera and IE, but not with Mozilla 1.7.3 and
Firefox 1.0 PR. When I call a function previously defined inside another
function I've got "function is not defined". Why?
View 2 Replies
View Related
Jul 16, 2009
had this in browsers areas but people told me I should put it here in Javascript because more people here would probably have seen it before and know why it happens. I have basic Javascript that rotates images. I've noticed any kind of Javascript code that rotates images has this same problem only in Mozilla. When the images rotate in Mozilla in between the rotations, Mozilla browser adds a little colored square that represents a blank image that are able to be seen does anyone know why Mozilla Browser adds that? For example when looking at this page in Mozilla can see it. if you know if this is some Mozilla problem with Javascript and images. Doesn't happen with IE and other browsers shows the images only and nothing else.
View 2 Replies
View Related
Jun 21, 2009
iam either being really dumb or something is way wrong with the code. i am trying to create a fade in / fade out effect. i know there are tons of scripts out there that do this, but i like to do it myself. my script is only working in firefox at the mo (when it works il cater for other browsers). basically i can get the fade out part to work, but when i want to fade back in it does nothing. now logically id of thought that fading in would be the same as fade out but reversed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
[code]....
View 2 Replies
View Related
Nov 30, 2010
I've a BIG Problem With a HUGE JS application , i'm modifying its javaScript code to work on both IE/Mozilla , currently it works fine on IE but not on Mozilla.
My main Point now is events.
Lets try with a little module, consider this function :
And it is attached in this place like :
This works fine in IE , i want to modify it to work on Mozilla.
View 2 Replies
View Related
Apr 26, 2011
So i've written up the code to do a lightbox esque overlay image gallery. everything is working smooth and fine. The only concern is that I have the following:
lets say that I have a page that has multiple galleries. Obviously I would have to make each literal array with the gallery data different names, ex:
var _gallery1 = {
'images': [
{ 'id' : 1, 'src' : "" }
]
[Code]....
obviously "galVariable" would be undefined... as i'm trying to get "_gallery2.images" but trying to use "galVariable" to point to "_gallery2"
I'm familiar with solving a problem like this in PHP, not so much javascript. is there a JS function that can be used to ensure that it's using whatever "galVariable" equals to, and then that array's content is? Or is there a different way to go on about this.
View 3 Replies
View Related
Apr 19, 2005
I have this code which shows a slidebar, adjusting it shows a number, 0-100 depending on where the bar is. Is there anything I can do to set the width of the slider, or replace the slider with a graphic of my choice. Code:
View 3 Replies
View Related
Apr 29, 2011
I've wanted to add a hint pointer on my form but it is clearly not working as proposed...[code]...
View 1 Replies
View Related
Sep 17, 2009
I need a java script code tat changes the mouse pointer to an image of my choice when a button or an image is clicked ..
View 7 Replies
View Related
May 3, 2011
On hyperlinks, and certain web controls when you put your mouse over the link/control it turns from the arrow pointer to the hand with finger so you know you can click. I am making a menu so that when you click a TR, you will have more options appear below it. There is no anchor or anything to change the mouse pointer. How exactly would I achieve this, either through JavaScript or CSS..?
View 1 Replies
View Related
Apr 9, 2010
I am trying to change both, the background color and the mouse pointer to hand on the mouseover event. Am using this to change the background color:
onMouseover="this.bgColor='#55FF55'"onMouseout="this.bgColor='#AEFFAE'"
How and I add the "change pointer to hand" on this as well?
View 3 Replies
View Related
Sep 30, 2011
I am trying to redevelop firefox addon, to give it more funcionality. I found JS file where all the functions are and started to edit it.
What I want to achieve is to get target of an anchor under mouse pointer (when mouse pointer is over anchor, I right click and call addon from context menu).
For example when I have anchor which HTML code is:
<a href="somewehere.com/place">place</a>
when I right click on this code and call my addon I would like to alert its href (somewehere.com/place)
I wrote a function:
function ff()
{
var current_target=this.href;
alert(current_target);
}
but it gives me udefined on alert
[URL]
View 2 Replies
View Related
Aug 27, 2006
in moz/nn, this errorsvar el = document.getElementById;
why?
pointers to core classes and/or singletons seem fine; this works for examplevar ord = String.fromCharCode;
alert(ord(100));
View 18 Replies
View Related
Jul 12, 2010
take a look at: [URL] i have an included .js file called fader.js which controls the fading panels at the top of the page. on line 84 of fader.js is a function called setMouseOverHandlers(). it sets it so that when you over over the current panel it does 3 things:
1) pauses the timer
2) replaces the navigation image with the paused state image
3) changes the cursor to a pointer.
the problem is with item#3... i cant figure out why i cant get it to give me the pointer cursor... all the other stuff seems to be working.
View 10 Replies
View Related
Sep 30, 2011
I am trying to redevelop firefox addon, to give it more functionality. I found JS file where all the functions are and started to edit it.
What I want to achieve is to get target of an anchor under mouse pointer (when mouse pointer is over anchor, I right click and call addon from context menu).
For example when I have anchor which HTML code is code...
View 7 Replies
View Related
Jul 20, 2005
I have a JavaScript routine that runs on a timer and updates the position of a
background image using the CSS background-position property. In Internet
Explorer, it changes the mouse pointer to an hourglass when it refreshes the
screen, and this is really annoying since it happens on the timer, about every
100 milliseconds or so. Is there anything I can do about this?
View 1 Replies
View Related
Jan 15, 2011
I'm making a webpage for a little embedded device with a touch screen. I don't want the mouse pointer to be visible until the user clicks on a link in which case the mouse pointer should change to an hour glass until the new page is displayed (the device is rather slow so the user needs to get some feedback while waiting). code...
This properly hides the cursor after the first page is loaded but it doesn't display the hour glass when I click on the link. Any ideas what I'm doing wrong?
View 1 Replies
View Related