Troy III 272 Posting Pro

yes it would.
check for the >>line<< and >>source<< of the "error code" and go get that string corrected.
p.s.: you don't even need the error console to tell you where to look, because its the file and the line of code you or someone else added or modified just before this error ocurred.

Troy III 272 Posting Pro

remove the code that forces focus to move to the next field will do

Troy III 272 Posting Pro

fast fix

[input].match(/[\d/]+/g).join('.');

might do the trick...

Troy III 272 Posting Pro

you are using a wrong doctype
use the damn standad!

Troy III 272 Posting Pro

$ and _
are two (and only) non-alpha characters that don't have any special or reserved meaning in js and are safe for use in names or for names as single char pointers or as leading ones. So the choice is more like a matter of convenience -using $ or _ as a single char pointer is less likely to be overwritten spontaneously by the coder compared to other regular letters like s, o, e or i. Yet, more procedural coders will $name or _name for reading semantics where $name would indicate that it's a name of a string value and/or _name to be some sub-property object or a derivative of some other higher level object etc.
They are left in reserve by the language, but with all the guys fleeing from static languages (and who until recently openly despised the live or dynamic script) yet being heard and having their say in js standards -who knows what future might bring.

Troy III 272 Posting Pro
  1. you will need to link that jQuery file to the modal window code also.
  2. or find a way to correct the reference it on jQuery methods.

p.s.: the second is 'probable' or 'less likely', -so I'd try my luck with the first one.
So good luck with it.

Troy III 272 Posting Pro

Of course you can...
Try:

time="10.29";
if ( time < 10.30 ){console.log("it is")} else {console.log("it isn't")};
>>"it is"

time="10.31";
if ( time < 10.30 ){console.log("it is")} else {console.log("it isn't")};
>>"it isn't"
Troy III 272 Posting Pro

Where did you learn that?!

Troy III 272 Posting Pro

did you test it on other than 'that' browser -is it consistent accross vendors?

Troy III 272 Posting Pro

do you have a link

Troy III 272 Posting Pro

(the complete answer)

Your question:

This string can potentially have any number of non-alphanumeric characters acting as delimiters. These delimiters can also be grouped together. I want to extract 00923, 5342 and 123 into an array from a string like var str = "00923:5342:123"

If what you wrote is exactly what you meant[?] -than my answer to you is absolutely correct:

console.log( str.match(/\d+/g) );
>> LOG: ["00923", "5342", "123"]

further more...
The:

ids =  str.match(/\d+/g) ;

//with:
for(var i=0,j=ids.length; i<j;i++)console.log("ids = ["+i+"] = "+ids[i])
// will:
>> ids = [0] = 00923
   ids = [1] = 5342
   ids = [2] = 123

The escape part was already corrected by you - so I don't see any possible problems with it.
So what is your real problem/task here?

Attention!
The extracted numbers on the returned array of matches are of string type, you will either relly on a duck-type conversion syntax or transform them explicitly onto a proper number objects.

Troy III 272 Posting Pro

Your question:

This string can potentially have any number of non-alphanumeric characters acting as delimiters. These delimiters can also be grouped together. I want to extract 00923, 5342 and 123 into an array from a string like var str = "00923:5342:123"

If what you wrote is exactly what you meant[?] -than my answer to you is absolutely correct:

console.log( str.match(/\d+/g) );
>> LOG: [00923, 5342, 123]

The escape part was already corrected by you - so I don't see any possible problems with it.
So what is your real problem/task here?

Troy III 272 Posting Pro

use:

    str.match(/d+/g);

in

    var ids = str.match(/d+/g);

ids wil be a ready array, so you can...

    for(var i=0,j=ids.length; i<j;i++) task.logmsg("ids = ["+i+"] = "+ ids[i]);
Troy III 272 Posting Pro

because it seems it convert the regex into an int value

nope...,
and as I've said: you don't need neither search nor regex patterns to make sure that value provided is a number, because
"parseInt" takes care of that.

so in "qty" you have a string which may or may not represent a number;
we leave it that way since you'll be needing it for latter display in your alert;
it's why we further derive it and introduce the var "q";
so instead of asking for a "-1" match & result;
we simply check if "q" is "NaN";
and if it is, we store it in your "cost" element value as you require;
meanwhile we alert the original input string 'qty' to the user as you've planned;
telling him that what he fed in is not a number... etc;
and (of course that), in case it was a number - we continue to the next statement.

p.s.:

if(q!=q)
is my raw but explicit isNaN test.

Troy III 272 Posting Pro

replace this:

function loadLink(siteList) { 
if (this.selectedIndex > -1) 
alert(this.options[this.selectedIndex].value) 
else 
alert('Nothing selected') 
}

with:

function loadLink(siteList) { 
if (this.selectedIndex > -1) 
location=this.options[this.selectedIndex].value; 
}
Troy III 272 Posting Pro
Troy III 272 Posting Pro

Don't worry about var module = instance || {};. It's just defensive programming.

I understand you concern,
but module EQ instance OR {}, is a perfect EMT ( error-masking-tool ), it defends your eyes from seeing some otherwise pretty obvious errors. Nothing beneficiary from that.

This line: "var Parousia = {};" is fundamental. So if for some unknown reason it went missing while having thee "defensive programming" line of code in place - there'll be no way to find out why is the whole app - "a sudden fail!?" - because you will be getting some completely unrelated error on some perfectly sound line of code which will confuse you even more or make you loose it completely.

Doing "var module = instance || {};" will not guard anything! In case of a missing global - You will be operating on a totally inaccessible local object instead of your targeted Parousia.

Now back to troubleshooting...

You have, from what I can see there, a property definition such as:

    Parousia.minion = (function() {
            var module = {};

            module.Unit = function() {
                this.id = 0;
                ...
                }
            }

            return module;
    }())

It should be:

    Parousia.minion = (function() {
            var module = {};

            module.Unit = function() {
                 this.id = 0;
                 ...
                 }
            return module;
    }());

And you have:

    var Parousia = {};
    (function (instance) {
        var module = instance || {};

        module.CANVASHEIGHT = 500;
        ...
        }
    }(Parousia));

It must be:

    var Parousia = …
Troy III 272 Posting Pro

you won't need to search for the correct input value, you could do this instead:

    ...
    var q = parseInt( qty );

    if( q != q )
    {    
        document.getElementById("cost").value = q;
        alert("You have entered " + qty + "Please enter a number");       
    }...
Troy III 272 Posting Pro

what do you mean by

var module = instance || {};

is it deliberate?

Troy III 272 Posting Pro

Nope the inf was correct!
Sorry I had to delete it
">>"You can't prototype the Sting and other built-in objects in Firefox!"<<"
Not anymoe!
I wonder though: - Is Firefox missing its old NN4.7 days - and thee reputation[?!]

Troy III 272 Posting Pro

I had to change my mind..., 'get inconsistent results with this...[problem]! -Would you mind checking if you are being able to prototype the String object on your Firefox?
'cause I'm having some problems with mine.

Troy III 272 Posting Pro
             "                     

             "                                             
Troy III 272 Posting Pro

a quick patch:

    reg.onclick = function(){createReg(cell7.id)}
Troy III 272 Posting Pro

this will work:
document.writeln( "<a href='#' onClick='popUpInfo(" +subject[i]+ ")'>" +subject[i]+ "</a>" );

easy yeah?

Troy III 272 Posting Pro

that would be:

navigator.language

and that would indicate the client language used in the system by that client on that terminal.

DarkMonarch commented: helpful tip +0
Troy III 272 Posting Pro

adn I liked the old editor better!

Troy III 272 Posting Pro

The terminology used is not exact, but we could call it a contextual script element, or something.
Such thing was possible in Explorer.

<div id=div1> div1 content </div>
<script for=div1 event=onlouseover src=div1.js></script>

But it becomes expensive, I never used it..

Troy III 272 Posting Pro

I would have most probably hit the ESC key before all this collateral code is loaded

<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
    <script type="text/javascript" src="js/process.js"></script>
    <script type="text/javascript" src="js/jquery.ui.core.js"></script>
    <script type="text/javascript" src="js/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="js/jquery.ui.mouse.js"></script>
    <script type="text/javascript" src="js/jquery.ui.slider.js"></script>

Just looking at it makes me go click on the x sign of the tab immediately.

Troy III 272 Posting Pro

Assuming there are no scripting errors on your code
you should try it with a defer attribute:

<script type="text/javascript" [B]defer[/B]>
 	$(function() {
		var dates = $( "#from, #to" )....
Troy III 272 Posting Pro

We know we already have built-in Trim methods, but trimming doesn't get rid of internal, (and unwanted) extra spaces. -So this is where Normalize method comes to play. It trims left, it trims right, but most importantly it also trims on the inside, one could say: "it trims inside-out". In fact it treats the text-string exactly as HTML parser does.

I had hard time to actually decide how to name the method but I finally did.

String.Normallize();

Using it is strait and simple

[string_var].Normalize();

I've also taken care to make it usable in a manner like:

"".Normalize("   this   string   contains to many   spaces   ");

//to return:

>> "this string contains to many spaces"//not anymore.

Which might prove useful in rare occasions, and most probably never. Yet it doesn't hurt having it at hand, even though using it like:

"   this   string   contains to many   spaces   ".Normalize();

as with other existing methods would also be possible, but I don't consider it as clean and as readable as previous.

Yet when working with strings, - speed is always an issue...
So I wrote a test and run a few tests. Turns out that 'blazing' is not an overstatement.

To make a browser 'sweat' and escape some pseudo-optimization cheats I took a string of 1024bytes [1KB] x 100 000 iterations = 10MB worth of data processed and the results were; - well, very satisfactory. (~3 seconds). Because to open, (that is) render a page …

Troy III 272 Posting Pro

I think this demo and template might help you a lot http://www.daniweb.com/web-development/web-design/html-and-css/code/226127

Troy III 272 Posting Pro

...
so, in order to solve possible problems with this I suggest you do some scripting for cross-browser normalization like

var text = document.body.textContent ? "textContent" : "innerText";
// which will enable you to access and modify the text content using:
   oElement[text]; >> "this element plain text content"
// or assign  
   oElement[text] = "this element new plain text"

And of course mark the thread solved.
p.s.:
(Prototyping it, -is currently a no go.)

Troy III 272 Posting Pro

Nice..,
in case you don't want the whole message, except the "good morning" salutation when time is less than 10, -you can move your script element up again,
and of course: mark the thread solved!

happy learning's.

Troy III 272 Posting Pro

Your question was:
"... if the time is more than 10.. the page will be directed to a another specific page .... anyone can help on this ?"
The answer is

<html>
<body>

<p>This example demonstrates the If statement.</p>
<p>If the time on your browser is less than 10, you will get a "Good morning" greeting.</p>
<p>Otherwise it will navigate you to a different page.</p>

<script type="text/javascript">
var d = new Date();
var time = d.getHours();

if (time > 10 ) 
  {
  location.href = "http://www.yourdomain.com/theOtherPage";
  }
else
  {
   document.write( "<b>Good morning</b>" );
  }
</script>
</body>
</html>

Script element is moved under the content to prevent overwriting your message.

Troy III 272 Posting Pro

The only browser that doesn't support the original innerText property and method is firefox.
It's not IE's fault that someone else took its feature and called it "my invention" by changing its original name. Never mind that it will cause the web to break! Which in return is its exact aim and the reason of renaming your tools in the first place.

Anyhow:
Using the innerHTML as an alternative to innerText was always possible but not always safe. It depends on what you are trying to do. If you are using it as a property or as a method which makes the main difference. Let's exemplify the distinction:

some div content:
"div with a [B]bold[/B] element"
used as properties of the element will return:

div.innerText >> "div with a bold element"
div.innerHTML >> "div with a <b>bold</b> element"

whereas, using them as methods for the same content
"div with a <b>bold</b> element"
will give you a:

div.innerText = "div with a <b>bold</b> element"
>>  "div with a <b>bold</b> element"
div.innerHTML="div with a <b>bold</b> element"
>> "div with a [b]bold[/b] element"

So it is safe to use, as long as the tool you are using, will do what you are aiming to.

Troy III 272 Posting Pro

And probably have no idea where did; nor when did xhtml4.0 came out neither?!
Mark the thread as solved and stop spamming the forum. IE will forgive an omission or two but will not tolerate the ignorance of an evil man.

Troy III 272 Posting Pro

So how do you translate this to English than?cite: "I want to know if it is possible (and if so, how) to trigger the click event that displays the enquiry form on the contact page if the page is accessed via the above link?"
Anyways, thanks for sharing with the community.
In javascript at least, you don't need to call for triggers, you simply do element.click(); and its clicked, which is so much cleaner.

and or for a completion sake as simple as:

location.search.match("part_number")?
oElement.click() : 0;

Ain't that twice as clean and far more simple?

But once again [just for the sake of curiosity ]
Trigger click event if page loaded from a certain referring URL
how do you translate this question into what you are saying now without some powerful trans-mutational alchemy?

Troy III 272 Posting Pro

And sorry for asking but...:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<a id='cart' href='/tires/cart'> Your Cart - (empty)</a><head>
	<title>Tires - Wholesale</title>

Why is that (red) line of code sitting there.
Syntax Error report is absolutely correct 2 line <a> tag in the document head;
Did you do this deliberately? Because I'm pretty sure you did...

Troy III 272 Posting Pro

1. Sorry for googleapis, my computer was blocking it... (had some attacks from there)

2. This:

;(function($){
$.fn.slideto = function(options) {
...

should not break a thing ever.
its an amulet-like syntax that will always guard you from unepected js voodoo.

() [parens] can interact in a great distance and some comment might be fooling you that the line break is an established fact, but it might just so happen that an external script at the end of all lines didn't have a line terminator and might have even been omitted knowing that its the end of the file that will terminate not only the line but the script as a whole. But that's not the case -because external scripts will all be appended as if residing in one single and uninterrupted document. So if another js file begins with (... without a leading ; it will be considered a function call of some end-declaration from the previous file.


3. Why don't you try correcting the:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

into

<!DOCTYPE html>
<html lang="en">

first, -and see what happens...
Anyway, you'll need some patience because this error will not be easy that to locate...;

in jquery-ui.min.js I've noticed an unnecessary line termination in code

...[0].offsetWidth,
height:d[g]...

which depending on the parser - might also cause problems.

Troy III 272 Posting Pro

http://i44.tinypic.com/dr9vlh.png
I cant even see the "show more" anywhere on your supposedly working browser let alone be able to fix it in explorer.

p.s:
1. linked scripts on the header load async., you slideto.js may be loading faster!
2.I suggest you always use ";" in front of self invoking functions, - I mean always. i.e:

;(function($){
$.fn.slideto = function(options) {
//and its never ever a bad idea to also finish it with one
);

I'm saying this for the first time in public and its a great advice.

3. and lastly -please check if the jQuery file is in the right place.
{now that I've checked, none of them are ! They are missing, try moving them on your own domain ajax google apis are either refusing to serve you, or are down or perhaps IE is refusing to load cross-domain scripts. But the same is happening with chrome:
Failed to load resource https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js ...
}

Troy III 272 Posting Pro

Nope that's not really true -just came back from your http://stmarytheboltons.org.uk/hall/index.html -and the code is working perfectly, on all browser modes quirks/standard (ie7 ie8 ie9) you name it. Other visitors can confirm this too.
p.s.:
since you are using .html extension please hold the shift-key while pressing F5 to refresh the page.

Troy III 272 Posting Pro

Nope, you are correct all the way. :)

Troy III 272 Posting Pro
document.referrer=="that location string"
yourLinkElement.click();
Troy III 272 Posting Pro

There's none I'm afraid. Or at least not a coder-friendly one. Other browsers have just recently stared supporting some of rich-text html editor commands and already made a mess out of it. There are to many stunt steps required and hope for the best in the end for it to make it happen.

Troy III 272 Posting Pro

you have an image with an ID = "next" on your document collection and you are not declaring it as a variable, meaning you are referencing to an already defined existing image object and trying make it a string on the fly, you cannot nullify that image and reassign a string instead. Secondly, you are using an obsolete doctype for the document. Correcting this will suffice...:i.e: <!DOCTYPE HTML>

Troy III 272 Posting Pro

Here is a working function for IE versions

function colorPick(x){
	var marked,color={};
	showColorPicker(x,color);
     if(document.selection){
	marked=document.selection.createRange();}
     else{marked=null/*try satisfy W3C bitchiness here*/}
	color_picker_content.onclick=
	function(){ return color.value ? setColor(color.value,marked) : false } 
	function setColor(color,marked){
		marked.text?
		  marked.text=marked.text.fontcolor(color) : 0;
		}
	}

In case you decide to use html/rich-text editor in the future this will do for html selections:

marked.pasteHTML(marked.text.fontcolor(color));

...no patience in dealing with w3c mess right now 'cause anyway this will get you up and running in no time...

p.s.: don't forget to use the other w3c bitchy enforcement of var color_picker_content = document.getElementById("color_picker_content"); nonsense for pleasing firefox there unless you decide to use my <!doctype native> definition instead of what you are currently using. (wasn't easy to find "color_picker_content" element to refer to! )

have fun.

Troy III 272 Posting Pro

now you see how easy it was, you should be more patient when asking people for help giving nothing in return, so even if their given code may prove to be wrong - never go "eeekkk" on them because even then, they've done it with their best intentions and were only trying to help by offering the best they've got.
'Cause you see, you didn't even bother to mark the tread as solved, even though there is no other method for changing the color of the string in place and on the fly, so that others may benefit too.

stay cool.

Troy III 272 Posting Pro

so what?
I never gave you the green code version for you to go "ekkkkk"
-how hard can it be to simply replace content from this:

document.write("<br>3+2 = "+answer1+" is incorrect! - "+("The correct answer is 5.").fontcolor('red'));

to this:

document.write("<br>3+2 = "+answer10+(" The answer is correct ").fontcolor('red'));

or removing the parens altogether since they may be confusing instead of helping

document.write("<br>3+2 = "+answer1+" is incorrect! - "+"The correct answer is 5.".fontcolor('red'));
document.write("<br>3+2 = "+answer10+" The answer is correct ".fontcolor('red'));
Troy III 272 Posting Pro

What don't work?!!
that don't work because you also lack copy-paste skills

Troy III 272 Posting Pro

Yes, but I would use "green" color for the correct one :p