Website Toolbox Pro

Need Help With Regular Expression?

Javascript, Regular Expressions Comments »
Hi all,
I need help with Regex (Regular Expression).

For example there's a webpage on a website, and I want to get the first link on that webpage, after certain words.
e.g:
"Website from http://www.website.com/blabla.php?var=blabla&se=3290 is awesome"

question: how to get the link only
http://www.website.com/blabla.php?var=blabla&se=3290

Here's a solution using javascript:

var strW = "website from http://www.website. com/blabla.php?var=blabla&se=3290 is awesome";
var regW = /(website|Website).* (http[^\s]*).* (awesome|great)/;
if (regW.test(strW)) alert (RegExp.$2);

Add/delete the key words preceding and following the URL. The URL is referenced using RegExp.$2

What’s The Best Book To Learn Javascript?

Javascript Comments »
I am a Javascript novice looking for absolutely THE BEST book available to learn Javascript. I want something that transcends the usual stodginess of regular textbooks, that is entertaining and relevant to use, showing quantifiable improvement and mastery through regular exercises throughout.

Oh, and I want the world as well.

Any advice?

Continue reading What’s The Best Book To Learn Javascript? »

Javascript Code That Lists All The Pages On A Website?

Javascript, PHP / MySQL Comments »
What is the Javascript code that you insert into the address bar that lists all the pages on a website?

Continue reading Javascript Code That Lists All The Pages On A Website? »

Regular Expression For Validating A String Which Contains Only Characters?

Javascript, Regular Expressions Comments »
Regular expression for validating a string which contains only characters in Javascript?

Continue reading Regular Expression For Validating A String Which Contains Only Characters? »

What’s The Difference Between JavaScript, Jscript, And ECMA?

Javascript Comments »
What’s the difference between JavaScript, JScript, and ECMA?

Continue reading What’s The Difference Between JavaScript, Jscript, And ECMA? »

How To Get Data Out Of Table Cells Into A Javascript Variable?

Javascript Comments »
Is it possible to get data out of table cells and put it into a Javascript variable? If so, how?

Continue reading How To Get Data Out Of Table Cells Into A Javascript Variable? »

What Does “Javascript”, “Dreamweaver”, “CSS” Mean And How Does It All Fit Together?

Javascript, Miscellaneous, PHP / MySQL Comments »
I’m new to this whole thing, I need to know for journalism class please!

How does HTML, CSS, Python, Dreamweaver, InDesign, PHP…. what do these things have to do with websites?

Continue reading What Does “Javascript”, “Dreamweaver”, “CSS” Mean And How Does It All Fit Together? »

Javascript: Using A String As A Variable

Javascript Comments »
I have a function that I send a javascript array to like so:

if (VAR_clicked == "one") {
    FUN_Table(VAR_array_one);
} else if (VAR_clicked == "two") {
    FUN_Table(VAR_array_two);
} else if (VAR_clicked =="etc") {
    FUN_Table(VAR_array_etc);
}

My problem now is I have many more arrays and want to do something like this:

FUN_Table("VAR_array_" + VAR_clicked);

I’m trying to use a string to pass a variable to the function, this does not work.
Any ideas as to how I can do this?

Continue reading Javascript: Using A String As A Variable »

Picture Change On Click Without Javascript

Images, Javascript Comments »
Do you know how to make a picture change when you click it, and then change back when you click it again? Preferably without Javascript if possible.
You can’t do something like that without Javascript. A mouse click is an event, and there is no way to process events but with Javascript. Use the onclick property of the img, div or a tag.

Javascript: Variables Within Regex?

Javascript, Regular Expressions Comments »
Is it possible to use a variable within a regular expression declaration? For example:

var findThs="test123";
var mystring = "This is some test123 text";
var result = myString.match(/findthis(?:,| |$)/);

This doesnt return a result since findthis is being interpreted as text rather than a variable. I want its contents to be inserted into the regex expression.

Continue reading Javascript: Variables Within Regex? »