Here is the code :
> var reg = new RegExp(" hel.lo ", 'g');
>
> var str = " helalo helblo helclo heldlo ";
>
> var mat = str.match(reg);
>
> alert(mat);
It alerts "helalo, helclo", but i expect it to be "helalo, helblo, helclo, heldlo" .
Only the half of them matches, I guess that's because of the space wich count only once. So I ...
Hi,
what is the quickest way to make clickable imagemap of the US? Is there any jquery plugin available for this?
Thanks
...
Hi,
Is it possible to track a button click within an iFrame if i don't have control over the external website or it's contents?
(very fictionnal example)if i had an iframe like this:
<iframe src="http://www.johnny.com/plugins/like.php?href=http%253A%252F%252Fexample.com%252Fpage%252Fto%252Flike&amp;layout=standard&amp;show_fa...
Hey, I was wondering whether there is a way to use FlexScroll (JavaScript custom image based scrollbars) with IFRAMES instead of the DIVS.
Yes, I know scrollable DIVS are better than IFRAMES. This is my clients requirement though.
Cheers.
...
how can I loop through these items?
var userCache = {};
userCache['john'] = {ID: 234, name: 'john', ... };
userCache['mary'] = {ID: 567, name: 'mary', ... };
userCache['douglas'] = {ID: 42, name: 'douglas', ... };
the length property doesn't work?
userCache.length
...
Ok, I am using umbraco forum module, and on the comment form it uses jquery validate plugin.
The problem is that I have added a search button on the same page using a UserControl, the search submit button triggers the comment form submission validation.
I have done some research, and added the 'cancel' css class to the button. This bypa...
I am writing some code to find the user selection in a contenteditable div, I'm taking my code from this quirksmode article.
function findSelection(){
var userSelection;
if (window.getSelection) {userSelection = window.getSelection;}
else if (document.selection){userSelection = document.selection.createRange();} // For microsoft...
I have a question regarding how Mobile WebKit browsers (ie Mobile Safari and Android browser) handle setTimeout function when the page becomes inactive and is reactivated again.
Let's assume the page becomes inactive (ie the phone screen goes to 'sleep' / we open another application / we open another webpage), and the setTimeout functio...
I want to make sure I understand callbacks properly, and javascript timing etc. in general.
Say my code looks like this, is it gauranteed to execute in order?
SetList(); // initilizes the var _list
Some.Code(_list, function(data) {
// update list
});
DoSomething(_list); // operates on _list
Update
What I am seeing is Se...
I have a really simple chat application on a site which works pretty good.
It requests by ajax like this:
$.ajax({
url: "fetch/"+CHAT_SESSION_ID+"/"+LAST_MESSAGE_ID,
dataType: "json",
cache: false,
success: function(data) {
if (data.session_active == 0) { //If other chatter ended session
alert("Session Ended");
}
...
When the browser is loading something on a page you can see it in the status bar that it says "Waiting for..." or "Transfering..." etc.
In firebug you can check in the net tab when something is being loaded and see when it stops. That is what I want.
Is there a way for me to trigger an event when that happens ? Or to get the status o...
I am having trouble displaying the jQuery datepicker as shown here:
http://jqueryui.com/demos/datepicker/
I believe I downloaded all of the proper files, but to be certain, I started from scratch and ripped the demo site. Not all of it, but what I believed to be the important parts. The result is no datepicker to be shown and no javas...
I apologize that this question is so similar to "How can you check for a #hash in a URL using JavaScript?" but would appreciate your help with the following.
I would like to use Javascript to display text that is
a) identified by an anchor.
b) contained within 2 collapsed DIVs....ONLY WHEN the anchor is in the URL. Otherwise, the page...
Is there any helper code out there that will allow me to write to firebug's log window, but at the same time not break if using IE/chrome etc.
...
I am doing some pre-production on a project that requires drawing on a 3d canvas, which I think flash is the best way to go. But there is a chance down the line that this client might want the site to show up on the ipad, iphone or other mobile devices that don't support flash.
So I was playing with the idea of doing everything in html...
I am creating a form with AJAX. The way I have created the form is by writing out the html form elements in the innerHTML of the div where I'm putting the form
div.innerHTML += ' <input type="text" name="day" id="eventDay" size="2" maxlength="2" value="'+response.day+'" />,';
div.innerHTML += ' 20<input type="text" name="year"...
How do I figure out if a variable is divisible by 2? Furthermore I need do a function if it is and do a different function if it is not.
...
I wanted to use a Rich Text Editor for a text area inside an update panel.
I found this post: http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors via this question: http://stackoverflow.com/questions/1207382/need-asp-net-mvc-rich-text-editor
Decided to go with TinyMCE as I used it before in non AJAX s...
I have created my entire website by using a main table, and having the content inside the table.
Some ppl suggest this is wrong, and I would like to know what to do specifically in my situation.
On my index.html I have a <table align="center"> and then all content in it.
Now the content is in form of DIVS and they all have relative po...
Let's say I have a page, http://mydomain.com/mypage.html, with a "Back to page" link. This link should take the user back to the page where they came from only if the previous page URL matches one of the following: http://mydomain.com/one.html, http://mydomain.com/two.html, and http://mydomain.com/three.html. Otherwise, it would take t...