473,915 Members | 5,000 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 1464
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
1158
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
1321
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
1806
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: +-------------------+ | Header | * Code for Header and
5
1403
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 System.Text.StringBuilder(); sb.Append("<script "); sb.Append("language='javascript'>");...
3
2929
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 probably needs to be an "array" of some sort, but I need some help figuring out where and how that works....
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 basic, but modifiying it now as a function inside my C/C++ code.
3
1678
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
11637
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 working in IE but I can't get it to work in Firefox. Problems: 1. The buttons (image buttons)...
3
3919
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 did not validate when i keyed incorrect data in the form and it straight away executed perl script...
0
11354
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
10923
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
10542
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
9732
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...
1
8100
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7256
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();...
0
5943
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4778
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
3
3368
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.