473,388 Members | 1,177 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,388 software developers and data experts.

eval() problem in Firefox

hello,

i hv some probs with eval() in firefox. it works in IE nicely.
here is the code.
[PHP]eval("document.getElementById('" + tblName + "').rows[0].cells[" + cellNo + "].innerHTML = document.getElementById('seat_" + seatNo + "').innenText" ); //innerText[/PHP]

any soluation??
Oct 2 '07 #1
7 2581
wow i got the solution..


Expand|Select|Wrap|Line Numbers
  1. eval("document.getElementById('" + tblName + "').rows[0].cells[" + cellNo + "].innerHTML = document.getElementById('seat_" + seatNo + "').textContent" ); //innerText
Oct 2 '07 #2
gits
5,390 Expert Mod 4TB
hi ...

welcome to TSDN ...

why do you use eval at all? in a 'regular' script there should never be a need for eval ...

Expand|Select|Wrap|Line Numbers
  1. document.getElementById(tblName).rows[0].cells[cellNo].innerHTML = document.getElementById('seat_' + seatNo).textContent
  2.  
should work fine?

kind regards

PS: FF/Mozilla has no innerText ...
Oct 2 '07 #3
drhowarddrfine
7,435 Expert 4TB
Specifically, innerText is not standard.
Oct 2 '07 #4
acoder
16,027 Expert Mod 8TB
Specifically, innerText is not standard.
Neither is innerHTML, but it's supported by probably all browsers.
Oct 2 '07 #5
gits
5,390 Expert Mod 4TB
the standards way probably would be to create/retrieve the entire node-hierarchy including textnodes etc. to append, replace, remove children out of the document tree and use regular dom-methods for that ... innerHTML sometimes shortens this way ... even when it is not the standard :) and i'm with acoder - i think all browsers support it ...

kind regards
Oct 3 '07 #6
mscir
1
Hi,

I have some obfuscated javascript that runs in IE 6 and 7 but not Firefox.

Does Firefox support eval?

Is there a reliable cross-brower way to use obfuscated javascript? I know it's not recommended but that's what I've been asked to provide.

Thanks,
Mike
Nov 12 '07 #7
acoder
16,027 Expert Mod 8TB
Does Firefox support eval?
It most certainly does.

Can you post the code that you're using?
Nov 12 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Scott Mitchell | last post by:
I am using the onbeforeunload client-side event to prompt a user when leaving a page after they have made changes, as discussed in this article: Using ASP.NET to Prompt a User to Save When Leaving...
12
by: knocte | last post by:
Hello. I have always thought that the eval() function was very flexible and useful. If I use it, I can define functions at runtime!! However, I have found a case where eval() does not work...
7
by: steveneill | last post by:
Is this an alternative to eval(). Admittidly, I have done *very* little testing (ran it a few times in Firefox), but it seemed to work suprisingly well with simple expressions such as...
4
by: Angel | last post by:
Hello Everybody, I have the following lines in my code 1) totalElements=eval("document."+formname+".RCBillingCycle"+totalRCRows+".length") 2) var newoption=new Option...
4
by: niko.nyman | last post by:
I noticed weird results when using eval() to do some simple calculations. Here are a few eval() statements and the corresponding results from JavaScript: eval("1.2+0.97") =2.17 eval("1.2+0.98")...
3
by: nishac | last post by:
My code is to change the frequency display as each radiobutton is pressed. ie,when radio button for daily is pressed corresponding data displays when radio for weekly pressed....etc The code works...
7
by: Darko | last post by:
Hello, I have this particular problem with eval() when using Microsoft Internet Explorer, when trying to define an event handler. This is the code: function BigObject() { this.items = new...
2
by: Florian Loitsch | last post by:
hi, What should be the output of the following code-snippet? === var x = "global"; function f() { var x = 0; eval("function x() { return false; }"); delete x; alert(x); }
4
by: Adam C. | last post by:
Mozilla.org suggests using the with statement to control bindings: var f = 2; with({f: 3}){ eval("f"); // evaluates to 3 } But that doesn't work for binding "this".
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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...

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.