473,498 Members | 1,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stategically place javascript???

Is there any way to to build javascrip on the client and place it exactly
where I want it in the html?

--
Dave
Nov 18 '05 #1
5 1038
this is all client stuff, why post to a server dev group?

Anyway, just put in a <span> or <div> tag and have the clientside code write
to that ID.

Please followup in a clientside/javascript group.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"DaveF" <df*****@geodecisions.com> wrote in message
news:uz**************@tk2msftngp13.phx.gbl...
Is there any way to to build javascrip on the client and place it exactly
where I want it in the html?

--
Dave

Nov 18 '05 #2
slap in a container and add your JavaScript as a LiteralControl. A panel is
as good an object as any (writes out as a <span> tag).

Panel1.Controls.Add(new LiteralControl("my javascript block");
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"DaveF" <df*****@geodecisions.com> wrote in message
news:uz**************@tk2msftngp13.phx.gbl...
Is there any way to to build javascrip on the client and place it exactly
where I want it in the html?

--
Dave

Nov 18 '05 #3
RegisterClientScriptBlock: places the script right after the <form>
RegisterStartupScript: places the script before </form> (after all controls)

to place it anywhere else, use a placeholder control, say

<head runat=server id=header>
</head>

then using the generic control, add script:

HtmlGenericControl sc = new HtmlGenericControl("script");
sc.InnerHtml = javascriptCode;
header.Controls.Add(sc);
-- bruce (sqlwork.com)
"DaveF" <df*****@geodecisions.com> wrote in message
news:uz**************@tk2msftngp13.phx.gbl...
Is there any way to to build javascrip on the client and place it exactly
where I want it in the html?

--
Dave

Nov 18 '05 #4
Thanks for the ideas. Basically I am trying to build a Tree structure with
multiple branches. It has LOTS of data. It is a skills matrix. I am woried
about it being slow. What is the best practice to code this. It almost seems
like old asp do while would be faster?

--
David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
da***@helixpoint.com
"bruce barker" <no***********@safeco.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
RegisterClientScriptBlock: places the script right after the <form>
RegisterStartupScript: places the script before </form> (after all controls)
to place it anywhere else, use a placeholder control, say

<head runat=server id=header>
</head>

then using the generic control, add script:

HtmlGenericControl sc = new HtmlGenericControl("script");
sc.InnerHtml = javascriptCode;
header.Controls.Add(sc);
-- bruce (sqlwork.com)
"DaveF" <df*****@geodecisions.com> wrote in message
news:uz**************@tk2msftngp13.phx.gbl...
Is there any way to to build javascrip on the client and place it exactly where I want it in the html?

--
Dave


Nov 18 '05 #5
I highly doubt ASP will be any faster - after all, it would be doing the
exact same thing, just in a different way maybe.

If you are sending tons of stuff to the client, that has tons of
javascript - then that will always be slow, the burden will be on the client
browser. I wouldn't worry about the actual act of writing javascript.

"DaveF" <df*****@geodecisions.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Thanks for the ideas. Basically I am trying to build a Tree structure with
multiple branches. It has LOTS of data. It is a skills matrix. I am woried
about it being slow. What is the best practice to code this. It almost seems like old asp do while would be faster?

--
David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
da***@helixpoint.com
"bruce barker" <no***********@safeco.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
RegisterClientScriptBlock: places the script right after the <form>
RegisterStartupScript: places the script before </form> (after all

controls)

to place it anywhere else, use a placeholder control, say

<head runat=server id=header>
</head>

then using the generic control, add script:

HtmlGenericControl sc = new HtmlGenericControl("script");
sc.InnerHtml = javascriptCode;
header.Controls.Add(sc);
-- bruce (sqlwork.com)
"DaveF" <df*****@geodecisions.com> wrote in message
news:uz**************@tk2msftngp13.phx.gbl...
Is there any way to to build javascrip on the client and place it exactly where I want it in the html?

--
Dave



Nov 18 '05 #6

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

Similar topics

0
1251
by: Steven K | last post by:
Hello, I have a Master Page with ContentPlaceHolders. I also have a content page which I need to add some JavaScript to. If I place the JavaScript in the content page, I get the following...
4
2213
by: Jaime Stuardo | last post by:
Hi all... I need to add some JavaScript code that is dynamically generated to some point of the page. Currently I'm using ClientScript.RegisterStartupScript(GetType(), "menu", "<script...
2
3032
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
2
1782
by: korund | last post by:
<html> <head> <title>Demo</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> function init() { alert('Message 1');...
3
5286
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
3
3616
by: Bateman27 | last post by:
Hi, don't know if this is the right place for this but wondered if anybody can help. When I try to open a picture on gettyimages, or a new chat window on MSN (either by clicking on the image, or on...
4
1522
by: -Lost | last post by:
I cannot for the life of me remember the site name, but I believe it was the site of one of the regular posters here or perhaps in comp.lang.java.javascript. Anyway... The site in particular...
5
9279
by: Tomislav | last post by:
Hello, I tried to use "javascript:return confirm();" function in following manner ( triggered by form onSubmit event ): ** <form method="post" action="mail.php" onSubmit="javascript:return...
10
2126
by: mark4asp | last post by:
I ask this because only today I read advice telling me to put it within the <headelement. This is the same advice I've always been given but no one ever explained why. Last week I was told to...
0
7126
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
7168
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
7210
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...
1
6891
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...
0
7381
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...
1
4916
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
3096
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...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
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...

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.