The purpose of this line is to get the "href" value of a link when clicked on inside a content-editable iframe.I have the function working perfectly in IE, but not having much luck with Mozilla browsers.
Can anyone explain why this just alerts [object]. I'm trying to change the background of a tr when it's clicked on, I only added in the alerts to see why it wasn't working.
<tr class="a"
function sel() { var x = event.srcElement; alert(x); }
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.
When you click on the "details" link, a modal window pops up with the job info.This works in IE, but nowhere else. My js skills are shaky, at best, but I did figure out that event.srcElement is IE only and that there are better, modern methods of achieving this.Problem is, I don't know how to implement them in this instance.How can I rewrite this so the modal window functions correctly in IE, FF, etc?Here's the code:
Code:
function displayDetails(num,ctrl) { for(var i=0; i<details.length; i++)[code]...
In this case the e.srcElement/e.target should return 'home' or 'about', but instead one of the two layers inside 'home' or 'about' will be returned. And these dont even have a onmouseover attribute! The following page is specially made to make it easy to fix the bug if you know how :-)[URL]
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.
Is there a way to achieve multithreading in JavaScript? I'm looking to fetch a page into a div while allowing the user to interact with another div. At some point the newly fetched page contents will be available to the div that the user is working in but I don't want to cause unnecessary blocking. I've thought of using frames (would prefer divs) plus timeouts and checking for when a load completes. Does anyone have an idea of how this could work?
A friend of mine has built as simple site for use on his company's intranet. It uses JavaScript to read comma-delimited information from a text file and displays it in tabular form.
When I looked at the source there is js like this:
function forwardClick() { if (sitelist.recordset.AbsolutePosition != sitelist.recordset.RecordCount) { sitelist.recordset.moveNext(); } else { alert("You are already at the last record in the database."); }}
wondering if there is a va_list equivalent in Javascript. Well, actually, I know that there is, but I don't know if its user... applicable. va_list in C/++ anyhow is a way of being able to pass in any number of arguments at the end of a function, I'll show an example:
So as you can see, the space is reserved at the end of the function declaration with the "..." syntax, and in the function body is expanded and processed. I could be way off here, but I think I'm on the right track.
I'm trying to find out if javascript has something akin to $$ in php.What I'm trying to do:
var costs = { cost1: 5, cost2: 10, cost3: 15 }
// Retrieve cost user has selected
alert(costs.selectedCost);
Its obviously a hyper-simplified example of what I'm trying to do, but the premise is the same. In PHP, I could use $$ to convert one variable into another, not sure if JS can do the same.
I have been trying to figure out how to access files on different servers through javascript, as i am converting an onsite myspace app to an iframe app, i need to get the contents of a file from the last.fm api and store it in a variable. Or maybe i could get it with php and store it in a javascript variable if that is possible,
Is there a javascript equivalent of PHP's nl2br() function? I have to send the value of a textarea to a new window that will display the text of what was in the box, which is why I need to somehow convert newlines to breaks.
If I am using srcElement (or "target" for non-IE models) to return various properties of an object I have clicked on, can I access for "label for" value in any way? I'm thinking, for example, of an input text box like this:
.... at the top, I should be able to access obj.name and get "hello" etc, but how can I access the label value of "fred"? I did try obj.label but it didn't work...
I've been using display:none on the style property of some <option> elements in my forms, which works fine with Mozilla - as expected it removes the option from my dropdown (although it still exists in the code). Is there an equivalent in IE?
The reasoning behind this is that I want users to rank objects using a <select> for each place (see below), and to remove the choice of earlier objects from <select> drop-downs later in the list.
I want to do some Win32 application automation from JavaScript. Is it possible? Failing that, is there a way to execute an application from JavaScript?
Does anyone know a way of passing parameters into a Javascript script 'from outside' via additions to the URL -- similar to (or even the same as!) the idea of CGI parameters?
Give me a sample program for converting Ascii value into its equivalent value.for example get the input as 65(Ascii value of A) and display 'A' as output
I'm looking to return DATE ONLY for yesterday's date. No seconds, milliseconds. Formatted either yyyy/mm/dd or mm/dd/yyyy. VB does it so easily Date()-1 will return 03/27/2007 if today is 03/28/2007. Why so many hoops for javascript? Any ideas?
Is it possible to get the contents of an iframe (I need a method that allows me to get the generated HTML code of an XML file that was transformed by an XSL file)?
Is there an equivalent in Konqueror's KJS engine to Gecko's __defineGetter__() and __defineSetter__() methods? Our web application uses a ton of Javascript, written based on Internet Explorer's object model as that's the primary platform that we're supporting. For Netscape support we uses __defineGetter__() and __defineSetter__() to emulate the many IE-only properties. I've tested our site using Safari, and to my surprise, it renders perfectly. Alas, it's completely non-functional. If it's somehow possible, I'd love to write a similar emulation library for KJS so that our non-Windows users would have an alternative to crummy Netscape/Mozilla.