473,785 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
+ 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 1657
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
3056
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 I mean, please look at this feedback my me: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3074c204-04e4-4383-9dd2-d266472a84ac If you think I am right, please vote for this feedback.
3
3126
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 hidden value. Here is my DataList control code: <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" RepeatColumns="4"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "itemname")%> <br>...
4
1833
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 fine. A box (defined by a css layer) is supposed to pop out to the right when the corresponding box on the far left is moused over. The first function defines a layer id to the next function which pops out the box. After debugging in Venkman, it...
3
6137
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 values of course come from the DataBase. I have a few values in the Database that have NULL as the value for MyDate. Its not ideal, but I don't have control of this one.
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 OleDbParameterCollection" whenI try to write a new record. Delete and Modify work fine its just the add record function causes the error.
4
4580
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> <asp:LinkButton ID="links" runat="server" Text='<%# Eval("links") %>' OnClick="LinkButton1_Click"></asp:LinkButton><br />
7
3316
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: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server...
7
1689
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 protected void Button1_Click(object sender, EventArgs e)
4
2907
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 is not a null value. I am not using any code behind (C#) to bind the data or manipulate the data. I have read that when there is a null value in the database that there is no record in the "dataset". Can anyone show me how to bind a value in the...
0
9646
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10350
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9957
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.