Well i have databse of quotes in TXT format i want the javascript which radomize that database meanseverytime when user come on my page then script ll pick up one sentence from data base and show it but i want diff sentence at each visit i have done in ASP i want that in JAVA script ...
What I'm trying to do is something similar to menu bar at the top of the page. Where it has Bio, Pictures, etc. I've searched the internet trying to figure it out and haven't had any luck.
i am making a content manager, i want to be able to have the user format text with bold, italics, fontsize, color, etc within the text field window, kind of like the page here where we post topics and reply, any ideas where i can find any free scripts for this?
Is there a way to change the displayed text on a web page using some combination of Javascript and DHTML? NOT in a text box. As far as I know (with my limited knowledge) the only way you can do this is with a textbox or images, which is not what I'd like to do. There's gotta be a way to do this, right?
What I want to do is create a HTML form that allows the user to enter data into about 10 fields, and then based on the entered data, writes out data strings to a text file. I am attempting to create a form for entering simple rectangle CAD data via a HTML form, which will be written to a text file, and then imported into a CAD program.
The form would contain prompt boxes for things like length, width, radius size, step/repeat, etc. When the user hits the "SUBMIT" button, the data strings would be written out to the filename the user specified. Below is an example of data strings to be ouputted. Variables are &L, &W, &R, &STEPX, &STEPY, &XN, &YN.
I'm going through some "learning by doing" of javascript through trial and error, and admittedly have a lot to learn. But in taking various scripts and dissecting them, I still can't figure out if what I want to do is possible, and that is this:
I'm trying to include a paragraph on my page that is randomly chosen each time the page loads. This I can do. But in this paragraph I'm trying to include varied text formatting (parts bold, parts different color, etc), and make part of it a link.
If I use unformatted, un-linked text, it works fine, but that's not my goal. When I try including html in the items from which to be selected randomly, whether by directly specifying the attributes or using CSS class references, nothing displays, which makes me wonder what of all this is the problem.
I have a textfield and you of course you can select text...
When they hit the bold button I want it to obtain the selected text and bold it, the hard part is trying to figure out if javascript can even OBTAIN selected text?!?!
I can do this in java if I have to, I know java better than javascript, it seems as that is the only way to do it from looking online.
In HTML I use <b>...</b> to make parts of a text bold. <h1 class = "Style-MyText">This text is normal. <b>This text is bold.</b></h1>
Now I'd like to do the same with a JavaScript. I tried HTML: <h1 id = "MyID1" class = "Style-MyText">.</h1> javascript: document.getElementById("MyID1").firstChild.replaceData(0, document.getElementById("MyID1").firstChild.nodeValue.length, "This text is normal. <b>This text is bold.</b>");
Unfortunately <b>...</b> is displayed as '<b>' and '</b>' and not interpreted to make the text bold. 'View Selection Source' shows: This text is normal. </b>This text is bold.</b>
Is there a way to make some parts of a text bold with a JavaScript?
I know this is probably a real simple one, but I'm obviously missing something..
I'm building a function that I'll use throughout a website in the situation that I have two text boxes - the two text boxes will generally contain the same data. After the user completes the value of the first textbox, I want to onChange the value of the first textbox into the second textbox UNLESS the second textbox already has a value.
Here's what I've done so far...
IN THE HEAD function CopyTextBoxes(TextBox1,TextBox2) { if(TextBox2.value = '') { TextBox2.value = TextBox1.value} }
IN THE BODY WITHIN THE FORM <input name="MailFrom" type="text" id="MailFrom" size="60" maxlength="100" onChange="CopyTextBoxes('MailReplyTo','MailFrom')"> <input name="MailReplyTo" type="text" id="MailFrom" size="60" maxlength="100">
Is there any sample code to use Javascript to load and display a text file?
It will be best if the user can select files using some kind of explorer. If that's complex, a text box to specify the file name will be fine as well. Once a text file is selected, I just need to display it in a text box.
I'm creating a simple memory game in which the user has to make pairs from cards. I would like the user to see the variable "trys" (the score) update on the page dynamically (in a text box would be great). I can do this by showing a msgbox every time try increments but this is annoying to use. I have been trying for hours to get this to work, using innerhtml. Code:
I want to be able to select a word when I highlight over any part of the word. When I say select the word, I want it to be highlighted as if I left clicked my mouse and dragged the cursor along the word. I want to do this so a user when putting the mouse over the word can quickly hit <ctrl>c to copy the word, without having to manually highlight the word.
This will be used multiple times in the script for specific words, not for every word in the script. For example:
User Password ------- --------------- admin adminUser dba sysDbAPa$$
So in my above example when mousing over either of the passwords, the entire password would be highlighted so I can quickly copy it.
MS has published on its sites javascript encoder, which enables "encrypting" javascript code. It allows hiding js code from being seen as a text file. There is a decoder for it, available in the net, freeware, srcdec14.exe.
I have tested both, encrypting, decrypting, the source and the final files are identical.
But what I met on a certain site is a js file, encoded I think in another way, because I cannot decrypt it using the srcdec14.exe.
This is why I have a question for genarally any information cons. this subject (are there several ways MS is able to read encrypted js files?, do you know other decoders?,...)
i'm having trouble writing to a text file with javascript, i've tried writing to a local text file on my own PC, and I've also tried writing to a local file on my own server, (which I have all permissions to do so...) I'd really like to write to a file that resides on my own web server. Code:
I came across this javascript scrolling text. My problem is :- I need to have a huge big long message/ messages, but after a certain point the scroller stops scrolling and goes back to the beginning so doesnt show every message that I want. I have tried to take out the <nobr> tags but that doesnt work. Is there anyone out there that can have a look at the code below and see if it can be modified to allow multiple lines of messages. Many thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin var l1 = 0; // left of ticker in pixel, or 0 to position relative var t1 = 0; // top of ticker in pixel, or 0 to position relative var w1 = 780; // width of ticker in pixel var ie = document.all ? true : false; var first = true; var l2 = l1 + w1; var l3 = l1 - l2; var l = l2; function tickinit() { if (ie) { if (l1 == 0 && t1 == 0) { pos = document.all['tickpos']; l1 = getLeft(pos); t1 = getTop(pos); } ticktext.style.posTop = t1; } else { if (l1 == 0 && t1 == 0) { pos = document.anchors['tickpos']; l1 = pos.x; t1 = pos.y; } document.ticktext.pageY = t1; } l2 = l1 + w1; l3 = l1 - l2; l = l2; setInterval('tick()', 10); } function getLeft(ll) { if (ll.offsetParent) return (ll.offsetLeft + getLeft(ll.offsetParent)); else return (ll.offsetLeft); } function getTop(ll) { if (ll.offsetParent) return (ll.offsetTop + getTop(ll.offsetParent)); else return (ll.offsetTop); } function tick() { l = l - 1; if (l < l3) l = l2; cl = l1 - l; cr = l2 - l; if (ie) { ticktext.style.posLeft = l; ticktext.style.posTop = t1; ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)"; if (first) ticktext.style.visibility = "visible"; } else { document.ticktext.pageX = l; document.ticktext.clip.left = cl; document.ticktext.clip.right = cr; if (first) document.ticktext.visibility = "show"; } first = false; } // End --> </script> </head>
On my site, I offer a free "Make A Site." If the user enters javascript, like a document.write, (it stores the whole page HTML in a database) the next time the user edits the page, it shows the document.write ed text on the page, since it wrote it... and it keeps the javascript. So if they open, save, open, save, etc the page, it will keep on document.writing into the source.
EXAMPLE: First creating the page, code:
Code: Hello, welcome <script>document.write('Good Afternoon');</script> Editing the page for the first time, code:
Code: Hello, welcome <script>document.write('Good Afternoon');</script>Good Afternoon Editing the page for the second time, code:
I am using DW8 and using the "Set Text of Layer" function which I have used on several occasions but for some reason it fails to work in IE6. IE7 and FF it works fine.
I am trying to move some text by clicking a button. When clicked the button runs the java script and this will then take the value in the text field and add 10 to it to create a new value, this is then used to move the text (id=h1) to a new position and to display the new value in a text field. My script is below but does not work. Im new to javascrip and there is probably something embarasingly obviour that Im missing. Code: