473,545 Members | 957 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

embedding html in a javascript function

hello,

i want to put some html into my javascript function. how do i
accomplish a task like that? thanks!

rick

Jan 17 '06 #1
9 1453
Rick wrote on 17 jan 2006 in comp.lang.javas cript:
i want to put some html into my javascript function. how do i
accomplish a task like that? thanks!


Why do you ask?

document.write( '<br>');

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 17 '06 #2
"Rick" <RS********@gma il.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
hello,

i want to put some html into my javascript function. how do i
accomplish a task like that? thanks!

rick


"put some html into my javascript function" -- huh?

What function? What HTML? Perhaps this:

<html>
<head>
<title>somehtml .htm</title>
</head>
<body>
<script type="text/javascript">
document.write( "<b>Hello World</b>");
</script>
</body>
</html>

If not then you'll need to elaborate.
Jan 17 '06 #3
well...i want to put some .asp code into my javascript function. i
have a function that, when the user presses a button, generates three
text boxes, and i want to add some asp code to that function so that i
can write the user inputted data over to my database. any suggestions?

Jan 17 '06 #4
Rick wrote:
well...i want to put some .asp code into my javascript function. i
have a function that, when the user presses a button, generates three
text boxes, and i want to add some asp code to that function so that i
can write the user inputted data over to my database. any suggestions?


Short answer is: You can't.

1. The browser makes an HTTP request
2. The server executes the ASP and generates an HTTP response
3. The browser recieves the HTTP response and parses the HTML, executing any
JavaScript it finds.

To send data from the browser back to the server to process that data with
ASP requires another HTTP request. This is typically done by directing the
browser to a new URL. Another option is the XMLHttpRequest object.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 17 '06 #5
"Rick" <RS********@gma il.com> wrote:
well...i want to put some .asp code into my javascript function. i
have a function that, when the user presses a button, generates three
text boxes, and i want to add some asp code to that function so that i
can write the user inputted data over to my database. any suggestions?


ASP code is executed on the server. That results in HTML, which is
sent to the client and displayed in the client's browser. Javascript
then runs on the browser. (This is the normal scenario, ASP is a
platform for which code can be written in VBScript, Javascript< or
other languages). In this case, having your Javascript function write
ASP code is meaningless. The way to get data from the client to your
DB is to submit a page, or use AJAX.

--
Tim Slattery
Sl********@bls. gov
Jan 17 '06 #6
yikes...so if i want to be have the user be able to write in a user
defined number of text boxes dynamically...i cant use javascript?

Jan 17 '06 #7
Rick wrote:

Are you responding to something?

http://www.safalra.com/special/googlegroupsreply/
http://oakroadsystems.com/genl/unice.htm#quote
yikes...so if i want to be have the user be able to write in a user
defined number of text boxes dynamically...i cant use javascript?


Yes can, but you should include a server side fallback, and you need to
write ASP capable of handling a variable number of inputs (as opposed to
changing the ASP with JavaScript, which isn't possible).

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 17 '06 #8
Tim Slattery wrote:
[...] ASP is a platform for which code can be written in
VBScript, Javascript< or other languages). [...]


Not Javascript, only JScript. A fine but important difference.
PointedEars
Jan 17 '06 #9
On 2006-01-17, Rick <RS********@gma il.com> wrote:
well...i want to put some .asp code into my javascript function. i
have a function that, when the user presses a button, generates three
text boxes, and i want to add some asp code to that function so that i
can write the user inputted data over to my database. any suggestions?


This newsgroup has an excellent Faq.

Bye.
Jasen
Jan 18 '06 #10

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

Similar topics

1
1145
by: J | last post by:
Hi everyone, I am fairly new to python (3rd day), but i am fairly keen on replacing javascript. I want to externalize some of the mehtod in my App, an allow user to imp char* lBuffer = "def handler(color):\n" " print 12"
4
1304
by: WindAndWaves | last post by:
Hi Gurus Here is another one - I am just soaking up all these new learnings! I have the following piece of html <IMG SRC="test.gif" WIDTH="320" HEIGHT="256" ALT="movie placeholder"> <BR> <A HREF="test.mov">Interiors</A> | <A HREF="althorpe1.mov">Interiors</A> |
8
1772
by: Alan Lue | last post by:
Hi, I'm trying to set up a webpage so that I can view multiple HTML files from the same page. For example, you might go to http://example.com/lab_tests.html and be able to view lab1.html, lab2.html, and lab3.html right on that page. If you're viewing this message w/a monospace font, the page layout might look like this: ...
5
1385
by: Joe Bonavita | last post by:
I need to change images with the click of a button but I don't want the entire page to refresh so I thought I should just use an embedded page. I'm trying to use the <object> tag for this but can't figure out how to change the page in the code behind. I tried a javascript like this: System.Text.StringBuilder sb = new...
3
2898
by: alice | last post by:
I've been trying for a long time to figure this out, to have a page with several MP3 clips, and each one having a custom start and stop button next to them to play the track. I finally found a bit of code that does this, but it's made for only one mp3 file. I don't know enough about javascript to customize the code myself. I know there...
6
465
by: mistabean | last post by:
Hello, first of all, I am a programming newbie, especially in python... Onwards to the problem, I have been having difficulty embedding a python module into my C/C++ program. (just a test program before moving on into the real thing). I have been making test runs using the codes from http://docs.python.org/ext/pure-embedding.html as a...
3
1664
by: anonymisiert85 | last post by:
At the moment i can run python-string-code from C (MinGW, WinXP) But how can i register a C-function in python-RUNTIME and call this C function from python - without wrapper dll's or libs??? STEPS: initialize python regsiter foo() ########### don't know how to do this run python-script "c=foo(a,b)"
1
11603
by: SeanBoyWalton | last post by:
Hi, I'm currently trying to build a website for a DJ friend of mine and I have come stuck with a couple of issues. I've searched everywhere and put some code together but I still have problems. I want to be able to map controls of the media player to images on the page ie - when user clicks play image - song plays. I can currently get it...
3
3893
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up javascript windows to say the field is not keyed into properly. However, when i convert this html(with javascript inside) into perl script, the perl script...
0
7456
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...
0
7649
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. ...
0
7802
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...
1
7410
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7744
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...
0
4940
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...
0
3442
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3437
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
692
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...

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.