I'm finally diving into regexp by porting a perl script over to js that uses regexp to compress javascript into a bookmarklet capable format.I've successfully worked out 90% of the expressions but am troubled with a few, this one at the moment is odd:I want to remove the first line if it hasjavascript:So I thought str.replace(/^javascripts+:s+/, "") would be ok. I want javascript text, any space, colon, any space and new line. what I'm doing wrong.btw this is the original perl version
I found this in felgall's page. I added script tag
<script type="text/javascript">
var re = /(t)he/g; var mystring = "Over the moon."; re.text(mystring); alert(RegExp.input); // or RegExp.$_ alert(RegExp.leftContext); // or RegExp["$`"] alert(RegExp.rightContext); // or RegExp["$'"] alert(RegExp.lastMatch); // or RegExp["$&"] alert(RegExp.lastParen); // or RegExp["$+"] alert(re.source);
</script>
I don't see message box. Please tell me what I can do.
I have been struggling to find the right solution to validating a username in a form to make sure it is unique. I don't want to use Dreamweaver's validate username because I want the error to appear on the same page next to the form field as it does with the Spry Validation. I use Spry validation for all the fields but it doesn't check to make sure the username doesn't already exist. I was wondering if anyone knew the code I would need to add to SpryValidationTextField.js, SpryValidationTextField.css and the actual form page to make this happen.
I've got a div "main" that gets it's width changed via state chart. Now, in main I've got a div "item_title" that needs to change in respect to the width of "main" -90px because I have a fixed width 90px div also in "main". The code I have isn't sizing at all, like the width isn't being applied. In the css I don't have a width declared to the "item_title" to make sure nothing is interfering.
I need to display some addition html within a form when a checkbox is clicked. I know nothing about javascript but am pretty sure we can do it.
Here is what the code will look like if the box is NOT checked:
HTML Code:
<tr><td><input type="checkbox" name="name1" value="yes"> Check Me!</td><td> </td></tr> However when the box is checked, I want some additional HTML to show, like this:
I am using this code load a file from server to display in to a div.
Code JavaScript: function getHTTPObject() { var xhr = false; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); [Code]...
I want to use the same script but apply for a button, clicking the button, a file called from server will display in the div "ask_seller". Since button has no href attribute, I don't know how to name the file that going to be called(or I don't know what is the usage in this case)
I'm trying to slightly alter the script found here,[URL].What i want to do is make the carousel work on a Next/Previous feature versus a 1, 2, 3 method. I tried to do it myself but found i was was just going in circles and nothing was working.
Javascript
Code:
<script language="Javascript"> <!-- function slideFolio(col){
I have a popup window that appears, created by a 3rd party javascript. I have the handle to the window, it's called "pop". I'm not sure if that is the handle to the window actually. typeof(pop) is "object" typeof(pop.parentNode) is "undefined" pop.document is undefined. pop.body is undefined. pop.focus() executes without errors but does nothing. pop.moveBy() does not exist. pop.location is the correct URL. I want to do something like pop.innerHTML = "hello"; but that just makes an error. I don't want to change the URL of the popup window.
i am debveloping a custom google map. how to alter the size of the map? i know it can be done because i did it for a college lesson but i've lost the code. also, is it possible to switch the default view to terrain as opposed to map?
I can access the drop-down value(s) the visitor has chosen by $("#ak option:selected").each(function () {... but now I want to force the drop-down list to be selected to a particular default value of my choosing ... how would I do this?I did try:
$("#ak option:selected").each( function () { $(this).text('-> Choose Accessory kind');
At the moment, the script creates a gallery with thumbnails from a list of images (from my basic understanding), and I want to add to it so the current code also picks up the text from the alt tag and displays that within a div box positioned absolutely elsewhere on the page, when the main image is displayed.Here is the javascript:
var gal = { init : function() { if (!document.getElementById || !document.createElement || !document.appendChild) return
I've written a function to change the font, this is working in IE but not in FF or Chrome. No errors come up in Firebug. Once this is working in both browsers I will change the function to gradually increase the size of the font to make it look as if the font is growing. This is why I haven't just assigned a class to the text. URL of the site with the script is [URL]
I've been trying to teach myself Javascript to figure out this problem, but I'm apparently not learning what I need to.The objective is this:I want to have a div appear below my mouse when mousing over different parts of my website.I know how to swap out the background images, I know how to change the div's sizes... It's just that I'm using one div, and in order to get this right, I need it to be positioned in different places under the mouse each time the image changes.I've got a cross-browser mouse-follow worked out, I just don't know how to edit the "divvx" and "divvy" variables when I mouse over the "boxtest" div. Here is the code I'm working on, maybe I'm just missing something obvious?
I haven't used jquery for quite a while and I'm trying to simply alter out the text in a div with an ID of "test" but I'm running into trouble. Code: var mytest = $("#test"); alert(mytest); I'm sure it's because I've selected the div as a whole, but I've tried selecting the first child with no success.
I suppose I should first chain in a "p" selector, then select the first item, but I'm not quite sure how to do it. What I think is my closest attempt is as follows: Code: var mytest = $("#test").("p")[0]; alert(mytest);
I'm new in jQuery. I have to alter randomly the order of the td elements of a table. My initial idea is: - Clone the original table (I can't modify it). - Disorder randomly the elements of the cloned table. - Show the cloned table.
The actual code is: <html> <head> <script src="[URL]"></script> <script type="text/javascript"> $(document).ready(function(){ }); </script></head> <body><script> $(document).ready(function(){ .....
We are working within a CMS and we have a dynamic text header that pulls into the top of the page. The problem is that there are certain titles that are too long and are breaking into other design elements. I'm thinking there should be a way to count the number of characters and then dynamically change the font-size of the header.
I got the functions i must use for a clock on a js file..i have to set up the variables for it on another js file though but those are easy enough.the question is...how do i make a Menu that the user can alter the display of the clock? eg: insted of 21:30 -->09:30 pm and so on...this thing s been buggin me for days now.
It's been too long since I've used javascript! What do I need to add to this code in order to remove the scrollbar (or scrolling option) and the browsers' address & tool bars?
Code: <script language=javascript> <!--hide from old browsers window.resizeTo(600,500); window.opener = self; //--> </script>
The above code is in the <head> of the page that is being resized and stripped of scroll/address/tool bars. And will it only work in IE?
The script below magnifies a small portion of a larger image in a separate box. Is there any way I can add to the code to alter the area and level of magnification shown from the original image onto the new box?
Code: <script type="text/javascript"> function DoMagnify(sender, e) { var posx = 0; var posy = 0; if (!e) var e = window.event; [Code]...