473,413 Members | 2,066 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,413 software developers and data experts.

Scripting problem

Can someone help me understand why this script sets only some of the
div.InnerText proerties of my page. If I set the language to VBScript and
remove the semicolons it works. I'm just getting started with javascript so
I appologize it this so simple.

<script language="javascript">
oFirstName.InnerText = <%=chr(34)&sFirstName&chr(34)%>;
oLastName.InnerText = <%=chr(34)&sLastName&chr(34)%>;
oMI.InnerText = <%=chr(34)&sMiddleName&chr(34)%>;
oEmpIDFld.InnerText = <%=chr(34)&sEmployeeID&chr(34)%>;
oTitleField.InnerText = <%=chr(34)&sTitle&chr(34)%>;
oDepartField.InnerText = <%=chr(34)&sDepartment&chr(34)%>;
oDivisionField.innerText = <%=chr(34)&sDivision&chr(34)%>;
oCompanyField.innerText = <%=chr(34)&sCompany&chr(34)%>;
oTelephone.innerText = <%=chr(34)&sTelephone&chr(34)%>;
oFaxPhone.innerText = <%=chr(34)&sFaxPhone&chr(34)%>;
oMobilePhone.innerText = <%=chr(34)&sMobile&chr(34)%>;
oStreet.innerText = <%=chr(34)&sStreetAddr&chr(34)%>;
oCityField.innerText = <%=chr(34)&sCityName&chr(34)%>;
oState.innerText = <%=chr(34)&sState&chr(34)%>;
oZipCodeFld.innerText = <%=chr(34)&sZipCode&chr(34)%>;
oLocationFld.innerText = <%=chr(34)&sLocationCode&chr(34)%>;
oEMailField.innerText = <%=chr(34)&sEMailAddr&chr(34)%>;
oWebLinkField.innerText = <%=chr(34)&sWebLink&chr(34)%>;
oDisplayName.innerText = <%=chr(34)&sDisplayName&chr(34)%>;
oAssistant.innerText = <%=chr(34)&sAssistant&chr(34)%>;
oTeamURL.innerText = <%=chr(34)&sTeamWeb&chr(34)%>;
oThumnailPhoto.src = <%=chr(34)&bBinObject&chr(34)%>;
</script>
Jul 22 '05 #1
4 1408
"scott cooper" <sc**********@charter.net> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
Can someone help me understand why this script sets only some of the
div.InnerText proerties of my page. If I set the language to VBScript and
remove the semicolons it works. I'm just getting started with javascript so I appologize it this so simple.

<script language="javascript">
oFirstName.InnerText = <%=chr(34)&sFirstName&chr(34)%>;
oLastName.InnerText = <%=chr(34)&sLastName&chr(34)%>;
oMI.InnerText = <%=chr(34)&sMiddleName&chr(34)%>;
oEmpIDFld.InnerText = <%=chr(34)&sEmployeeID&chr(34)%>;
oTitleField.InnerText = <%=chr(34)&sTitle&chr(34)%>;
oDepartField.InnerText = <%=chr(34)&sDepartment&chr(34)%>;
oDivisionField.innerText = <%=chr(34)&sDivision&chr(34)%>;
oCompanyField.innerText = <%=chr(34)&sCompany&chr(34)%>;
oTelephone.innerText = <%=chr(34)&sTelephone&chr(34)%>;
oFaxPhone.innerText = <%=chr(34)&sFaxPhone&chr(34)%>;
oMobilePhone.innerText = <%=chr(34)&sMobile&chr(34)%>;
oStreet.innerText = <%=chr(34)&sStreetAddr&chr(34)%>;
oCityField.innerText = <%=chr(34)&sCityName&chr(34)%>;
oState.innerText = <%=chr(34)&sState&chr(34)%>;
oZipCodeFld.innerText = <%=chr(34)&sZipCode&chr(34)%>;
oLocationFld.innerText = <%=chr(34)&sLocationCode&chr(34)%>;
oEMailField.innerText = <%=chr(34)&sEMailAddr&chr(34)%>;
oWebLinkField.innerText = <%=chr(34)&sWebLink&chr(34)%>;
oDisplayName.innerText = <%=chr(34)&sDisplayName&chr(34)%>;
oAssistant.innerText = <%=chr(34)&sAssistant&chr(34)%>;
oTeamURL.innerText = <%=chr(34)&sTeamWeb&chr(34)%>;
oThumnailPhoto.src = <%=chr(34)&bBinObject&chr(34)%>;
</script>


Change
<script language="javascript">
to
<script type="text/javascript">

Try enclosing the ASP in quotes; for example:
oFirstName.InnerText = "<%=chr(34)&sFirstName&chr(34)%>";

I haven't worked with .innerText so I can't help you there (yet).
Jul 22 '05 #2
Thank you for the answer but that didnt work.

"McKirahan" <Ne**@McKirahan.com> wrote in message
news:2L********************@comcast.com...
"scott cooper" <sc**********@charter.net> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
Can someone help me understand why this script sets only some of the
div.InnerText proerties of my page. If I set the language to VBScript and
remove the semicolons it works. I'm just getting started with javascript

so
I appologize it this so simple.

<script language="javascript">
oFirstName.InnerText = <%=chr(34)&sFirstName&chr(34)%>;
oLastName.InnerText = <%=chr(34)&sLastName&chr(34)%>;
oMI.InnerText = <%=chr(34)&sMiddleName&chr(34)%>;
oEmpIDFld.InnerText = <%=chr(34)&sEmployeeID&chr(34)%>;
oTitleField.InnerText = <%=chr(34)&sTitle&chr(34)%>;
oDepartField.InnerText = <%=chr(34)&sDepartment&chr(34)%>;
oDivisionField.innerText = <%=chr(34)&sDivision&chr(34)%>;
oCompanyField.innerText = <%=chr(34)&sCompany&chr(34)%>;
oTelephone.innerText = <%=chr(34)&sTelephone&chr(34)%>;
oFaxPhone.innerText = <%=chr(34)&sFaxPhone&chr(34)%>;
oMobilePhone.innerText = <%=chr(34)&sMobile&chr(34)%>;
oStreet.innerText = <%=chr(34)&sStreetAddr&chr(34)%>;
oCityField.innerText = <%=chr(34)&sCityName&chr(34)%>;
oState.innerText = <%=chr(34)&sState&chr(34)%>;
oZipCodeFld.innerText = <%=chr(34)&sZipCode&chr(34)%>;
oLocationFld.innerText = <%=chr(34)&sLocationCode&chr(34)%>;
oEMailField.innerText = <%=chr(34)&sEMailAddr&chr(34)%>;
oWebLinkField.innerText = <%=chr(34)&sWebLink&chr(34)%>;
oDisplayName.innerText = <%=chr(34)&sDisplayName&chr(34)%>;
oAssistant.innerText = <%=chr(34)&sAssistant&chr(34)%>;
oTeamURL.innerText = <%=chr(34)&sTeamWeb&chr(34)%>;
oThumnailPhoto.src = <%=chr(34)&bBinObject&chr(34)%>;
</script>


Change
<script language="javascript">
to
<script type="text/javascript">

Try enclosing the ASP in quotes; for example:
oFirstName.InnerText = "<%=chr(34)&sFirstName&chr(34)%>";

I haven't worked with .innerText so I can't help you there (yet).

Jul 22 '05 #3
What is the reason that you're doing this? What's oFirstname? A span or a
div somewhere? Why not just write it out like:

<html>
<body>
<span id="oFirstname"><%=sFirstname%></span>
</body>
</html>

Also, get in the habit now of using spaces between operators.

<%=Chr(34) & sFirstname & Chr(34)%>

If you don't use spaces, you'll run into trouble when you have a variable
name that starts with H, since &h is the prefix for a hexadecimal number.

Ray at home
"scott cooper" <sc**********@charter.net> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
Can someone help me understand why this script sets only some of the
div.InnerText proerties of my page. If I set the language to VBScript and
remove the semicolons it works. I'm just getting started with javascript
so I appologize it this so simple.

<script language="javascript">
oFirstName.InnerText = <%=chr(34)&sFirstName&chr(34)%>;
oLastName.InnerText = <%=chr(34)&sLastName&chr(34)%>;
oMI.InnerText = <%=chr(34)&sMiddleName&chr(34)%>;
oEmpIDFld.InnerText = <%=chr(34)&sEmployeeID&chr(34)%>;
oTitleField.InnerText = <%=chr(34)&sTitle&chr(34)%>;
oDepartField.InnerText = <%=chr(34)&sDepartment&chr(34)%>;
oDivisionField.innerText = <%=chr(34)&sDivision&chr(34)%>;
oCompanyField.innerText = <%=chr(34)&sCompany&chr(34)%>;
oTelephone.innerText = <%=chr(34)&sTelephone&chr(34)%>;
oFaxPhone.innerText = <%=chr(34)&sFaxPhone&chr(34)%>;
oMobilePhone.innerText = <%=chr(34)&sMobile&chr(34)%>;
oStreet.innerText = <%=chr(34)&sStreetAddr&chr(34)%>;
oCityField.innerText = <%=chr(34)&sCityName&chr(34)%>;
oState.innerText = <%=chr(34)&sState&chr(34)%>;
oZipCodeFld.innerText = <%=chr(34)&sZipCode&chr(34)%>;
oLocationFld.innerText = <%=chr(34)&sLocationCode&chr(34)%>;
oEMailField.innerText = <%=chr(34)&sEMailAddr&chr(34)%>;
oWebLinkField.innerText = <%=chr(34)&sWebLink&chr(34)%>;
oDisplayName.innerText = <%=chr(34)&sDisplayName&chr(34)%>;
oAssistant.innerText = <%=chr(34)&sAssistant&chr(34)%>;
oTeamURL.innerText = <%=chr(34)&sTeamWeb&chr(34)%>;
oThumnailPhoto.src = <%=chr(34)&bBinObject&chr(34)%>;
</script>

Jul 22 '05 #4
Thanks that is MUCH simpler.
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
What is the reason that you're doing this? What's oFirstname? A span or
a div somewhere? Why not just write it out like:

<html>
<body>
<span id="oFirstname"><%=sFirstname%></span>
</body>
</html>

Also, get in the habit now of using spaces between operators.

<%=Chr(34) & sFirstname & Chr(34)%>

If you don't use spaces, you'll run into trouble when you have a variable
name that starts with H, since &h is the prefix for a hexadecimal number.

Ray at home
"scott cooper" <sc**********@charter.net> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
Can someone help me understand why this script sets only some of the
div.InnerText proerties of my page. If I set the language to VBScript and
remove the semicolons it works. I'm just getting started with javascript
so I appologize it this so simple.

<script language="javascript">
oFirstName.InnerText = <%=chr(34)&sFirstName&chr(34)%>;
oLastName.InnerText = <%=chr(34)&sLastName&chr(34)%>;
oMI.InnerText = <%=chr(34)&sMiddleName&chr(34)%>;
oEmpIDFld.InnerText = <%=chr(34)&sEmployeeID&chr(34)%>;
oTitleField.InnerText = <%=chr(34)&sTitle&chr(34)%>;
oDepartField.InnerText = <%=chr(34)&sDepartment&chr(34)%>;
oDivisionField.innerText = <%=chr(34)&sDivision&chr(34)%>;
oCompanyField.innerText = <%=chr(34)&sCompany&chr(34)%>;
oTelephone.innerText = <%=chr(34)&sTelephone&chr(34)%>;
oFaxPhone.innerText = <%=chr(34)&sFaxPhone&chr(34)%>;
oMobilePhone.innerText = <%=chr(34)&sMobile&chr(34)%>;
oStreet.innerText = <%=chr(34)&sStreetAddr&chr(34)%>;
oCityField.innerText = <%=chr(34)&sCityName&chr(34)%>;
oState.innerText = <%=chr(34)&sState&chr(34)%>;
oZipCodeFld.innerText = <%=chr(34)&sZipCode&chr(34)%>;
oLocationFld.innerText = <%=chr(34)&sLocationCode&chr(34)%>;
oEMailField.innerText = <%=chr(34)&sEMailAddr&chr(34)%>;
oWebLinkField.innerText = <%=chr(34)&sWebLink&chr(34)%>;
oDisplayName.innerText = <%=chr(34)&sDisplayName&chr(34)%>;
oAssistant.innerText = <%=chr(34)&sAssistant&chr(34)%>;
oTeamURL.innerText = <%=chr(34)&sTeamWeb&chr(34)%>;
oThumnailPhoto.src = <%=chr(34)&bBinObject&chr(34)%>;
</script>


Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Quest Master | last post by:
I am interested in developing an application where the user has an ample amount of power to customize the application to their needs, and I feel this would best be accomplished if a scripting...
2
by: Fedroz | last post by:
Hi! Here is my problem: I'm trying a simple script copied by MSDN for read a text file and put the content on output web page! I use the following code: Const ForReading = 1, ForWriting = 2,...
8
by: Rodd Snook | last post by:
I have an application which makes extensive use of the Scripting.Dictionary object. I'm not doing anything silly like putting them outside the page scope -- just creating quite a few of them and...
9
by: Vijai Kalyan | last post by:
Hello All, I have a few questions which you might seem irrelavant and/or foolish. I am asking anyway so I can find out. 1. Is XSL as powerful as a programming language such as Java in its...
2
by: dito | last post by:
I have a .asp page that contains an activex componet. When I launch it in a browser, it returns an error that the viewer is unable to create it's resource objects. "To rectify this problem,...
1
by: MatthewRoberts | last post by:
Howdy All, I am having difficulty with two-way communication across AppDomains in an attempt to dynamically script applications. Everything works as expected, except when using ByRef parameters....
4
by: Dimitris | last post by:
Hello, I have a problem that it seems easy but its really not. I am using Microsoft remote scripting for a site that I am making. Everything is going pretty good except one thing. My values which I...
9
by: Code4u | last post by:
I have an application that manipulates large arrays of image data of various types, all the usual arithmetic operations on the data objects are supported. With careful design and tricks similar to...
7
by: Scott M. | last post by:
How can I disable the cross-site scripting check for one particular page of a site?
8
by: Nagarajan | last post by:
Hi group, I need to develop a web application. I am in a fix as to choose among the various server-side scripting options. I want to explore python (am a newbie) to gain expertise and upon search,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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
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,...
0
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...

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.