javascript

Interesting html glitch in jquery variable with characters like &, /, etc.???

Hi, I'm trying to add html around div contents that my jquery function returns after the ajax request. It does work and adds a little of the html code I've added but upon submitting the "new" modified data with the addtnl html... it strips out this "&aoe=1&q=90" and other parts of the html code that include the & symbol and //? var ur...

looking for transpiler: php to javascript

hello, i wonder, if there's any transpiler available, which converts (simple) php code to javascript? what i am not looking for is ajax stuff or javascript libraries imitating php functionality, but i am looking for a translater, which is able to generate javascript code from php code (similar of what google is doing with GWT and the j...

how pass data using submit() in javascript?

hi in my asp age I'm using javascript that is below, I want to post data from one page to another using javascript post method? below is the javascript i using.. In "test1.asp" page <script type="text/javascript"> function Service_Add(Data_ID,Data_Type) { var Data_ID=Data_ID; var Data_Type=Data_Type; document.miformulario.submit(...

Jquery. Why this doesn't work?

This is html code: <a class="cat" href="#">category</a> <span class="kiti" style="position:absolute; padding:5px; margin-left:-18px; display:none; background-color:#000"> <a href="#">sub1</a> <br /><a href="#">sub2</a> </span> And functions...

jquery / JS allow only numbers & letters in a textfield

What would be the easiest way to allow only letters/numbers in a textbox. We are using JS/jQuery, but don't want to use a validation plugin? ...

Random border colours

I'm in the middle of theming a tumblr site, and each image posted is contained within a ".photobox" class. Is there a piece of javascript or jQuery i can use to change the "border-color" attribute of ".photobox" in the CSS to a random color - preferably chosen from a list of pre-defined colours? I've found one or two scripts on here but ...

How to use arrow keys to reload new URl in browser

Facebook and myspace both have a nice feature in the photo galleries, when you go to an image page, a page with the user's image and user comments on the page. You can hit you keyboard left and right arrow key and the page will load the next page, it does it super fast, if you held down the key it would go fast through many pages. I kn...

How to cache the result of $.post-request in jQuery?

I have a small jQuery script that gets information by looking at an ID. What is the best way to prevent that the same data are requested more than once (e.g. what's the best practices for caching in jQuery)? I have tried to use $.post and $.ajax with option "cache" set to true, but the request is being sent more than once. Is it bette...

JQuery hover function causes my div to hide

In my functions.js I have: $(document).ready(function() { $("#cat").hover(function() { $("#kiti").show(); }) $("#kiti").mouseout(function() { $("#kiti").hide(); }) }) Html file: <a id="cat" href="#">category</a> <div id="kiti"> <a href="#">sub1</a> <br /><a href="...

retype password verification

Please give me some JavasSript code so that I can implement retype password verification while changing a password. ...

Regexp: Trim parts of a string and return what ever is left

Hey, Im trying to use regexp to get whatever's behind the # in my string "12344dfdfsss#isa", in this case I wanna get the 'isa' out of the string. I found these answers (http://stackoverflow.com/questions/578821/how-to-remove-a-small-part-of-the-string-in-the-big-string-using-regexp) helpful, but all it returns is 'true'. var myString...

select text on focus

ive got this function and it works to select text on click function select_text(ev) { if (this.createTextRange) { // This is for IE and Opera. range = this.createTextRange(); range.moveEnd('character', this.value.length); range.select(); } else if (this.setSelectionRange) { // ...

How to use jQuery Validation plugin with metadata and the jQuery Forms plugin (with some xVal as well)

I've been doing some development using the xVal framework for .NET to link up some of the validation rules for models on the server side along with some client side validation using the jQuery Validation plugin along with the jQuery Form plugin for submitting the form. The scenario is the following: Allow the client to perform basic v...

Need some help with making this function...

I have a php page where users may enter data into fields inside a form. The form also has a picture upload utility. This page is refreshed every time a new picture is uploaded, so to 'remember' the values the user ALREADY has filled in, I have this code: <input type="text" value="<?php echo @$_POST['name'];?>"> This DOESN'T work for d...

Client Side javascript call from ASP control throws "Too many characters in character literal" error!

I have a javascript to enable text boxes when called, I want to trigger this code when a user picks value "Custom" from a dropdownlist, so that I can display/Hide these new textboxes. <asp:DropDownList ID="DateRangeDropDownList" runat="server" Enabled="False" **OnSelectedIndexChanged="EnableTextBoxes('SomeValue');"**> ...

How to Set the Source Parameter using OAuth on Twitter?

Hello, my name is Fernando and I was here asking if there was a way to set the parameter 'source' using REST. Today, after some testing, I managed to implement OAuth in the library and I succeeded in publishing a message directly by OAuth configured for my application, but do not see what I had set for the field source, even using OAuth ...

jQuery animation / hover and fade

This is my index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd&quot;&gt; <html> <head><title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css" media="all"> <script type="tex...

Prevent logging of AJAX calls in console tab of Firebug like Twitter

Hey, Need to know how i can prevent logging my AJAX calls in Firebug's Console tab, the way Twitter does. When you search in Twitter you get a live update feed saying "5 tweets since you searched". Twitter sends periodic AJAX calls for the live updates, however these AJAX calls do not get logged in Firebug's console tab, you will be ab...

Detect link ID onClick

So I have a 4x3 matrix where the red or blue squares are links. When I click on the links, I want to get the ID of the links, however, I get this error on line 63: TypeError: Result of expression 'targ' [undefined] is not an object. I am using code based on this http://www.quirksmode.org/js/events_properties.html#target Heres a live exa...

Client Side javascript call from ASP control doesn't reset visibility

I have a javascript to enable text boxes when called, I want to trigger this code when a user picks value "Custom" from a dropdownlist, so that I can display/Hide these new textboxes. function setVisibility(DropDownListID) { var element = document.getElementById(DropDownListID); var element1 = document.getElementById("TestBox1")...