javascript

Does an API Rate Limit see javascript requests as coming from the domain's IP, or the user's IP?

An API has a rate limit based upon the number of hits from a certain IP address. My requests are AJAX - so they're performed by a javascript living somewhere on a page. Does the IP being rate limited appear as the client's or the site's? ...

hash vs specific parameters

I am in the process of writing a small javascript library to make form creation/validation easier. This is mostly an excuse to get better with javascript. I am debating about how to take in user input for form element creation. I am looking at two approaches. One is to take in a few pre-determined parameters such as id, label, value Th...

JQuery- hotkeys and windows prompt issue

By referring to http://jshotkeys.googlepages.com/test-static-01.html I try to implement this powerful tool and facing some issue. everytime when I click Ctrl S, it will popup a window prompt asking me whether I want to save my testing.html I want to ignore windows prompt. What I want is simple: 1. when people click save button/ use s...

Merge keys array and values array into an object in Javascript

I have: var keys = [ "height", "width" ]; var values = [ "12px", "24px" ]; And I'd like to convert it into this object: { height: "12px", width: "24px" } In Python, there's the simple idiom dict(zip(keys,values)). Is there something similar in jQuery or plain Javascript, or do I have to do this the long way? ...

JCE Pro - Any good?

Hi Guys, I was wondering if anyone has had any valid experience with JCE Pro ? http://www.syntropy.se - javascript obfuscation Or any other good obfuscation methods for that reason ? ...

What is the cause of getting Java script error on this._xmlHttpRequest.abort(); for my pager?

In my application pager is showing Java Script error. I am restricting entering alphabet through filtered Textbox. In java script function I am showing alert for zero and blank value and Is is creating 2 errors. Any suggestion could help. Thanks in advance !!! ...

Opera 9.02 freeze by JavaScript

this Script cause freeze . <input type="button" onClick="onClickHandler();" /> . function onClickHandler(){ var form = document.getElementById("form"); if(form){ var textarea1 = document.getElementById('textarea1'); if(textarea1){ if(textarea1.style.color.match(/170/)){ textarea1.value = ""; }else{ ...

ASP.NET - What is the best way to keep jquery from cluttering up my ASPX files?

I'm starting to use more and more jquery. I'm working with dialogs, and each dialog (including javascript) is taking upwards of 20-30 lines of code. There's a few pages where I'll have over 5 dialogs. This gets ugly fast. I haven't even begun to get into sliding interfaces or calendar controls yet. I have more of a PHP background... an...

Is there a native machine code compiler for Javascript?

Hello, Is there a native machine code compiler for Javascript? I'm not talking about a VM. If it doesn't exist can it be done? I am wondering if it can be compiled to binary due to the dynamic nature of the language. Thanks in advance, Omer ...

How to pass the value of a textbox in a datagrid to javascript

Hi, I have a textbox inside my datagrid whose id need to be passed to javascript.The id of my datagrid is Datagrid1 and that of textbox is txtItem.All these are inside a contentplaceholder.Now i have passed the id of textbox as ct100_ContentPlaceholder1_Datagrid1_txtItem.It shows an error in my javascript as "Object reference not set to ...

Confirm message in ASP.NET

hello, I wrote this statment in my code: Response.Write("<script language=javascript>confirm('The system not allow negative inventory,continue?');</script>"); how can I handel if the user clicked "Ok" or "Cancel" button? ...

How to decouple javascript programming from frameworks?

I have one question about Javascript frameworks. I'm using ExtJs on my application, but there are many problems with licensing and such things, so i wonder about this thing. Is there a way to follow some strategies in developing Javascript so that i could easily switch from one Javascript framework to some other framework? ...

hi everyone, what do these "this" mean in this simple javascript program?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>test</title> </head> <body> <script type="text/javascript" charset="utf-8"> (function(){ /...

Get an array from an HTML page?

I'm rather new to HTML programming. I understand the basics of interactive collection of input via forms. I'd like to collect some data computed by a JavaScript function during execution of a page. Not being able to think of an alternative, I think the way to do that is to enter the function result into a form variable. How do I do ...

jQuery Append UL with LI with value from dropdownlist on button click

I have a dropdownlist: <select id="ContentList" name="ContentList"> <option value="">Please Select</option> <option value="TEST_TOP">TEST TOP</option> </select> I have a sortable list: <ul id="sortable"> <li class="ui-state-default">First</li> <li class="ui-state-default">Second</li> <li class="ui-state-default">Third</li> ...

extjs load image in TreePanel

Hi, i created a Ext.TreePanel and i would have in the node an image, in the text of the node i have the url to the image but i can't load it in the page, i see only the text, there is the possibility to view the image? this is my code var root1 = new Tree.AsyncTreeNode({ text: 'Legenda degli starti PAT', draggable:true, // disable ro...

jQuery Sortable Connect Lists - store values in list items?

I am looking at the demo for sorting items here but I want the text in the list to appear as something but when I click save and it posts server side I want to use values. I know <li> doesn't support value so what options do I have? UPDATE: I assume the way to save the data server side is to have a hidden input, when the user clicks a s...

Get element by ID in JavaScript

I use JavaScript and this error appears for me during execution: Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object this my code: <asp:Content ID="content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <script language="javascript" type="text/javascript"> function ConfirmTransfe...

How can I get image from Open Flash Chart 2 ?

I have tried tutorial from their homepag (http://teethgrinder.co.uk/open-flash-chart-2/adv-upload-image.php), but that doesn't work at all. My server side is working ok, but when I try to get instance of ofc and call post_image, Firefox gives following error "ofc.post_image is not a function". Is there any workaround for this problem ? ...

How do I add "onload" to my Dojo class?

I'd like to add an "onload" function to my custom Dojo class such that it can call functions that register to for the event - something like myWidget.addOnLoad(...) My class is not a Dijit it's a simple class that uses dojo.declare. Upon creation several functions are called (xhr, etc) to initialize the class and I need the ability to n...