I have got a bookmarklet for use with Opera which highlights all
occurrences of some text in the displayed page. I find it very
useful.
Sometimes I need to use two or three different colours for different
keywords I want highlighting on the same page. I have done this by
changing the original word 'yellow' for other javascript colour
words.
I know next to nothig about javascript. So I would ask if anyone
knows how I can tweak this javascript bookmarklet code (see below) in
two sepearte ways:
(1) So that I can select a color from a list. This may be as simple
as changing the caption to say "enter 1 for lime, 2 for yellow," etc.
or it might be cleverer.
(2) This is mutually exclusive with (1). In this case the
javascript would prompt me to enter a javascript colour keyword (like
"yellow" or colour code like "FF00FF").....
I am looking out for a regular expression that takes the following format
textfile_20060711_113441.txt
where textfile = name of the file 2006 = year 07=month 11=day 11=hour 34=minute 41=seconds. .txt is extension
The file always comes in the same format. however we need to implement checks so that user doesnt enter invalid month/day/hour/minute etc.
I have created the following regular expression textfile_(?<Year>(?:d{4}|d{2}))(?x)(?<Month>d{1,2})(?<Day>d{1,2})_([01]?[0-9]|[2][0-3])([0-5][0-9])([0-5][0-9]).[a-zA-Z]{3}
Can anyone guide me as to how do i modify this regex to suit my requirement. This regex currently is not able to handle invalid months or days etc.
Also i do not know how to integrate this regex in my javascript. Pointers or examples will be helpful.
I'm a flash designer and new to jquery. I've a little experience customizing javascript for html, but for the most part this is new to me (and pretty frustrating, I must say). Glad there's a jquery forum and hopeful that I can get some pointers.
Here's my problem: I am using a terrific bit of jquery code for a custom pageflip effect, however if I put an html link on the same page, it doesn't work. I'm guessing that this has to do with the pageflip code designating the two corners of the "book" to function onClick, however I don't know how to get around this. Here's a link to the code I'm using: [URL]...s there a bit of jquery I can use for a link instead of the traditional HTML tags? Or is there some other way to add a link that won't be interfered with by the pageflip code?
I'm trying to perform a very simple validation of user input. I want to verify that the user entered a six-digit string consisting entirely of numbers. So anything from 000000 to 999999 is considered valid. The problem that I'm having is getting the validation to work on the entire string. In other words, 000000 is okay but 000000000000 is also returning as a match. Here's a quick code block...I have something along these lines....
That is failing when I enter 123456 into the textbox. Why, though? I know I can replace...
if (sNumberValue.match(/A[0-9]{6}z/))
....with something like...
if (sNumberValue.length == 6 && sNumberValue.match(/[0-9]{6}/))
....or I could assign a maxlength to the input box, of course. The thing is, I really want to know WHY the regular expression isn't responding as I'd expect. Is there a syntax error somewhere in the code?
I'm developing a table that'll have dropdown filters above it. However my table has a slight twist in that some columns will have more than one value in them, eg imagine a column with these values:
- UK - UK - UK, USA - UK, Germany - Germany - USA
Now when I filter by 'UK' it should show four results - not two. Can anyone give me a few pointers how to do this or point me towards a plugin that might tackle this already? The values will always be comma separated.
I'm trying to tweak a small script to pull some data from an iTunes podcast formatted XML feed. Currently, it outputs a link to the most recent actual mp3 file with the episode title as the name (which is great), but I'd also like it to show a description of the episode under the link.Here's the code I have so far:
Code: jQuery( function($) {[code].....
How can I tweak my existing code to output the content of the first <itunes:subtitle> entry under the link it generates?
I need a regular expression to format U.S. currency as 1,215.25 (commas and decimals)...if it is not already in that format. It should also allow a '-' sign as the first character for negative numbers. I have looked in the FAQ and through this group, plus the net and cannot seem to find the right example.
Any pointers or solutions appreciated. Thanks. I found the belowposted in this group:
<script type="text/javascript"> var RgX = /^$(d{1,3}(,d{3})*|(d+))(.d{2})?$/
function sonKare(sayac, oteki) { var vertical, horizontal = hangiYataySira(sayac, oteki), j, k, l, m, united, tekRakam, actualV = [], actualH = [], numaralar = [1, 2, 3, 4, 5, 6, 7, 8, 9], olmayanlar = [];
[Code].....
This is a recursive function. As stated above there is a line which does not work for the second time. What I mean is, it works perfect for the first time and after function calls itself, it doesn't work. Javascript does execute the line above it but just disregards that document.form1.buton.click(); line. I use Firebug for debugging and I checked it many times, when that expression needs to be executed for the second time, JavaScript just ignores it and immediately goes at the end of the function... I just can't figure out why JS does such a thing?
It has to be flexible in that the extension can be either 4, 5, or 6 chars (.php, .html, .shtml for example) and needs to cater for and whether querystring parameters exist too.
--------------------------- Windows Internet Explorer --------------------------- <EMBED src=http://www.youtube.com/v/JTmM3jut05Q&hl=en&fs=1& width=500 height=200 type=application/x-shockwave-flash allowfullscreen="true" allowscriptaccess="always"></EMBED>
how can i get "src" value in above code using regular expression?
IE has had, since IE4, the use of: expression( [function or script expression]) within a style block declaration to dynamically set the value of a css property. Does Netscape v6+ and/or mozilla have anything of the sort?
does anyone know how I can build a regular expression e.g. for the string.search() function on runtime, depending on the content of variables? Should be something like this:
var strkey = "something"; var str = "Somethin like this";
I need a regular expression that will validate a double quote comma delimited list where the odd entries are numeric and the even are alphabetical. Each pair must also be on a separate line. For example:
"1","Peter" "2","Paul" "3","Mary"
I've used the following expression to validate comma delimited lists, but without the double quotes, numeric/alpha pairing and line return restriction.
Normally I can write regular expressions decently well but for some reason I am having trouble getting this to work. I am validating form data and need to throw an error if there are ANY spaces in the field. abc123 is fine, abc 123 is not. Any character is fine, just not a space.
All I'm trying to do is delete the lines which don't contain a particular string. Actually a filter to edit a log file. I can find and replace a thing with null, but can't figure out how to find the lines which do not contain the thing.
Going further, I want to generalize and use a JavaScript variable containing the decision string, but first I need to worry about the not-within-a-line problem.
Is there an available function in jQuery that would let me extract certain string of characters in a given expression, say I have the expression "2|23|6|niece", i wanted to extract 2,23,6 and niece from the given expresion and assign each in a variable leaving the (" | ") character