473,480 Members | 2,001 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Write value in layer using eval

1 New Member
Hi ,
I'm calling some Javascript function to write value in the layer. I'm trying to achieve it by using eval() function. Please look at the code below:

Expand|Select|Wrap|Line Numbers
  1. function showMore(tempLayerNum, tempLayerName) {
  2.  
  3. var temp = "step"+tempLayerNum+"More".toString();
  4. eval(temp).write("Hi");
  5.  
  6. }
  7.  
This is very simple code but still not working. Some other place same type of statement is working. Any idea what mistake I'm making here...

Regards,
Haresh
Aug 31 '07 #1
3 1639
acoder
16,027 Recognized Expert Moderator MVP
Changed the thread title. Please use a good thread title. Also, don't forget to use code tags when posting code. Thanks!
Aug 31 '07 #2
gits
5,390 Recognized Expert Moderator Expert
hi ...

welcome to TSDN ...

i would never recommend to use eval besides the need to evaluate json-data ... in case you simply want to add text to a html-node use something like the following:

Expand|Select|Wrap|Line Numbers
  1. var layer = document.getElementById('your_layer_id');
  2. var text  = 'whatever_text_may_include_markup';
  3.  
  4. layer.innerHTML = text;
  5.  
kind regards
Aug 31 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
I'm calling some Javascript function to write value in the layer. I'm trying to achieve it by using eval() function. Please look at the code below:

Expand|Select|Wrap|Line Numbers
  1. function showMore(tempLayerNum, tempLayerName) {
  2.  
  3. var temp = "step"+tempLayerNum+"More".toString();
  4. eval(temp).write("Hi");
  5.  
  6. }
  7.  
Welcome to TSDN!

You don't need to use eval for this. Show the HTML code for the layer.
Aug 31 '07 #4

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

Similar topics

40
3001
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what...
3
3112
by: webserverpete | last post by:
I am new to ASP.NET in general, but I do have experience with classic ASP. I am using a DataList control with a hidden value to submit to a different page, however I do not know how to get to that...
4
1819
by: jsreblev | last post by:
Hi Javascript gurus: I have tried several things, using several Javascript books, but can't get this to work in Netscape (latest version) and Firefox (latest v.). It works in MIE and Opera...
3
6113
by: sloan | last post by:
<asp:BoundField DataField="MyDate" DataFormatString="{0:d}" HeaderText="My Date" /> I have a BoundField being populuated with the "MyDate" column. The MyDate is in a strongly typed DataSet. The...
1
541
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
4
4562
by: bushi | last post by:
hi ! i have following code to display some text on a web form,after getting it from database. <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1"> <ItemTemplate>...
7
3275
by: Jim in Arizona | last post by:
I'm brand new at ajax. In fact, about 20 minutes ago was the first time I got it to work. The problem I'm having on another page did not work, however. I'm running into the following error: ...
7
1674
by: Smurfas | last post by:
Hi, I write News Script: Write news skript, but how maket that - Whent I push "Read Full News" show full news? Some like that: http://blogs.msdn.com/ Sorry, for bad English My script ...
4
2875
by: justice750 | last post by:
Hi All, I am using a FormView control. The allows me to update records in the database. However, when a database field is null I can not update the field on the form. It works fine when the field...
0
7048
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,...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7091
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
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5344
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,...
1
4787
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2999
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...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
564
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.