Need a function to strip off a set of illegal character in javascript: |&;$%@"<>()+,
This is a classic problem to be solved with regexes, which means now I have 2 problems.
This is what I've got so far:
var cleanString = dirtyString.replace(/\|&;\$%@"<>\(\)\+,/g, "");
I am escaping the regex special chars with a backslash but I am h...
Hi Everyone!
I'm trying to acquire a JSON which is being sent from an https secure site,
The client was hoping not to use any Server-side languages (the whole thing in Javascript)
I've read that I must use JSONP in order to load a JSON from a secure site, when using the .ajax function from Jquery.
My first question would be what for...
I mean is it possible to have the Draggable Area a circle(for example), not rectangle which have the predefined width and height or just to define you own area ? How about some implementations in JS, Flex ? Can someone help me with some suggestions, thanks a lot!!
...
In the result list when I hover over the result it bubbles just the links but not the text. I'd like it to bubble the whole result of the element that is being hovered. What do I need to edit in the jQuery library to have the effect? Please see screen shot, "Test App 62" to the line that says "Test" is one entity. The next starts at "Tes...
I'm running some JavaScript via eval (I know, shoot me), that basically enumerates all of the properties on the document object. My issue is that while it works in firebug, it throws a not implemented exception in Firefox, when run from a script.
Link to JavaScript script, the exception thrown, and the firebug command working.
Any sugg...
Hello everyone and thanks in advance.
I have a problem and I have 2 form into one another, the domestic form is to perform a file upload.
As I can do to make when sending in internal form not run the main form.
<form name="x" method="post" action="xxx.php">
....
<form action="" method="post" enctype="multipart/form-data" t...
I have a form page where I have a back button and a print button both on the top and bottom of the page(coded in javascript). The back button at the bottom of the page is not working in the Internet Explorer whereas the top one and both the print buttons works good. The code chunk is same for both of back button. In addition all the butt...
The web app I'm working on has several fairly complex and stateful pieces of client-side UI. I'm trying to keep things sane by organizing them into composable javascript widgets. Some of the requirements are:
1) Some of the data required to initialize the widget needs to come from the server
2) Some of the data comes from the client (ba...
How can I change a JS element to see if it is a node or an empty variable?
...
I have an anchor tag that calls a JavaScript function.
With or without JQuery how do I determine if the shift key is down while the link is clicked?
The following code does NOT work because keypress is only fired if a "real key" (not the shift key) is pressed. (I was hoping it would fire if just the shift key alone was pressed.)
var ...
I have the following working code to make a element of my scrollbox visible:
var next = elements.item(i+1);
var xpcomInterface = scroll.boxObject.QueryInterface(
Components.interfaces.nsIScrollBoxObject);
xpcomInterface.ensureElementIsVisible(elements);
But I would like to make a smooth-scroll (slow or not). Any idea how to do it?
up...
I have an html page with a header, a table containing 100 items and a footer.
When there is a search, I highlight the row containing the data.
However, if the highlighted row is row 75, the user has to scroll down to find it.
How can I automatically scroll to that row?
I did see scrollTO() but see it only takes axis points.
Any ...
Such as
var myName = 'Bob';
myName += ' is a good name';
For long operations of this, it there a better way to do it? Maybe with a StringBuffer type of structure?
Thanks! :)
...
I want to start learning jQuery, but there's so much you can do with it. I'm interested in using PHP as well.
I understand that Visual Studio has intellisense for Javascript, but isn't that for ASP.NET? Can you build PHP applications in Visual Studio?
...
I am relatively new to JavaScript and keep seeing .extend and .prototype in third party libraries I am using. I thought it had to do with the Prototype javascript library, but I am beginning to think that is not the case. What are these used for?
...
Im using firefox 3.6.10, and firebug to debug
So, here is my code:
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url,false);
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send(null);
alert(xmlhttp.responseXML);
responseXML is always null, and i've tried it on several URLs from different domains. I have also...
What are the differences and/or advantages, if any, of using commas when declaring a group of variables rather than semicolons.
For example:
var foo = 'bar', bar = 'foo';
versus
var foo = 'bar';
var bar = 'foo';
I know that if you specify the var keyword on the first variable in the first example it persists across all of the vari...
I have this function which will validate an email address. jsLint gives an error with the regular expression complaining about some of the characters being un-escaped.
Is there a way to correctly escape them?
var validateEmail = function(elementValue){
var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
return...
I'm not finding what's the type of this "xpcomInterface", and there's no documentation of any class with this name. Any idea?
This snippet is from Mozilla's website:
var next = elements.item(i+1);
var xpcomInterface = scroll.boxObject.QueryInterface(
Components.interfaces.nsIScrollBoxObject);
xpcomInterface.ensureElementIsVisible(eleme...
In this javascript hide/show example, how can I close all other divs when a div is selected?
<script TYPE="text/JavaScript">
function show_hide(id, show)
{
if (el = document.getElementById(id))
{
if (null==show) show = el.style.display=='none';
el.style.display = (show ? '' : 'none');
}
}
...