javascript

Twitter Button Stopped Showing Count 0

Ok so the official Twitter Share button has stopped display the counter if the count is 0. I've fixed this before with the Facebook share button (wants 3 shares before it shows the counter), but can't seem to fix it with the twitter button. Has anyone had any luck overriding this and forcing the counter to show at all times? ...

Get caret position in contentEditable div

Hi, I'm finding tons of good, crossbrowser anwers on how to SET the cursor or caret position in a contentEditable DIV, but none on how to GET or find its position... What I want to do is know the position of the caret within this div, on keyup. So, when the user is typing text, I can at any point know its cursor's position within the...

Stop execution of Javascript function (client side) or tweak it

Hi! I want to stop the execution of one single line from a site, so that the whole page is read by the browser except that single line. Or the browser may simply skip the execution of that javascript function. OR Is there way i can tweak the javascript somehow so that the random number generating function in javascript do not generate...

Overlay pop-up user license agreement

Hello! I'm looking to create a Javascript Pop-up Agree/Deny User License Agreement when people visit any page on my website. I just need suggestions on a good Javascript plugin to use for my idea. What I'm looking for: Never pop-up's again after user clicks Accept (To prevent pop-up every time user clicks a link.) Visitor canno...

Stacked Tabs Interface (two or three rows of tabs)

I am looking for a solution for having stacked tabs in a web page. I know there are tons of tab implementations out there, but I haven't been able to find one that allows for multiple rows of tabs. When you select a tab from one of the rows above, that row of tabs would drop down to just above the content area (Windows does this in som...

How to detect if document.write() has taken place in JavaScript?

I want to do something when 2 document.write() statements have successfully occured. I tried the following but it didn't work: function loadFields() { var load1 = document.write("<input type='text' name='StoreLocation' value='"+storeLocation+"' />"); var load2 = document.write("<input type='text' name='co...

How can I get all values of a mysql table in JSON from a php script?

This is php script that fetches a table values from mysql (one row). & echoes it as JSON <?php $username = "user"; $password = "********"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("spec",...

What percent of the time is unload or onunload called? And Why?

Hi all, I have heard in the past unload, or onunload, is not always called. However, I would like to know how often it is not called. What conditions lead to it not being called? Is this different for Firefox and IE? Thanks, Grae ...

Event when css is done

At a certain stage, I am applying css to a section of my page. Is there an event one can get once the re-layout has completed? ...

ECMA- / Javascripts Array.prototype.forEach

Hi Folks, Javascript (ECMAscript) supports the Array.prototype.forEach method since version 1.6 (ECMAscript edition 3, 2005). So quite a lot of browser already support that method and it's incredibly fast in comparison to jQuery's $.each() method for instance. (Actually it beats all implementations, regardless which Javascript library) ...

Firebug constructor function vs user function

I have made a quick search about what is the mean of Firebug DOM tab coloring and I've got that: Red colored bold text points "constructor function" Green colored bold text points "user function". here is the reference link What is the difference between the two type of functions. For example: I have a page that included jQuery.js, ...

Facebook create page through the FB JS API

I've not found a way to create a FB page through the FB JS API in FB docs or Google, somebody knows how to create a new page (a business, artist, etc.) hrough the FB JS API? Thanks in advance ...

tinyMCE - Can you configure an editor height below 100px?

Hi, I am not all that familiar with TinyMCE, but I cannot seem to configure it with a height below 100px. I've tried and it seems to always set it as 100px any time it goes below. I only need a few of the buttons and the editor window will likely never go beyond one line, so I am trying to reduce a bit of interface clutter. ...

How to do a redirect without the original referrer showing?

I need to do redirect my site visitors to a third party site, without the original referrer showing as the urls disclose private information. Is there a way to instruct a browser redirection without a referrer being sent to the destination site? E.g. using javascript? Thanks ...

How do I access class variables from an event in Javascript?

I'm using the prototype javascript libraries. My code is below. I've created a class and in that class I have created an event listener for one of the class methods. In that method I need to access both the attributes of the form element that triggers the event and the class properties. Currently, the code understands $(this).getValue...

Scroll to top of parent frame on iframe change?

Is it possible to scroll(0,0) to the top of the parent page when the user browses in an iframe. For example we have an iframe that is the entire height of the page with search results. When you click the next page button in the iframe, the focus stays at the bottom of the page. I'm not even sure if is possible to detect this. The ifra...

How do I change this Javascript Regular Expression to be non-case sensitive?

I have this regular expression below to validate a security question where some one has to type in the answer twice. My client want the answers to be none case sensitive. So if someone types in Chester and the in the second field they type in chester it will match. What can I do to this expression to make that happen: /^(\w|[a-zA-Z\d\...

How is ExtJs or DOJO different from JQuery

Can someone explain the differences in simple terms? ...

How to ensure only valid numeric characters are entered into a textbox?

Is there any existing jQuery functionality that can test if characters entered into a textbox are either numeric, or valid in a number? Such as .00 or 0.00, but not 0.00.00 or 0a What I'd like to do is catch any invalid characters before they appear in the textbox. If it's not possible with jQuery, what's the best way to approach thi...

javascrip/jquery and php ajax force error

Is it possible to force an error state to return to an ajax request from a php script. I am handling the success and error states in an ajax request and i want a way to force the error. The error only seems to be triggered b y xhttp error and i want to trigger this when a condition is not met at the server. Its seems confusing to have...