javascript

How do I get this expression Chr$(&H8) in Javascript

How do I get this expression Chr$(&H8) in Javascript. I need to get this escape code in Javascript sCmd = Chr$(&H8) + Chr$(&H2) Thanks a lot. ...

Dynamically load data into a List Controller in Dashcode? (Via JSON)

How can you do this? ...

Javascript 2D array

Hi Gurus, I am trying to use 2 dimensional array in javascript for storing strings. But I am not able to get the values correctly. Below is my code. var commentstore=new Array(); function creating(id,day) { if(commentstore[day,id] != null) { alert("It already exists: commentstore["...

Why I can't call method on nativeApplication.applicationDescriptor in Javascript?

Hi, In my html file which is in Adobe AIR project, I write following code to get a reference to the application descriptor: var appXML = air.NativeApplication.nativeApplication.applicationDescriptor; The statement is executed successfully. I can see appXML is referenced to the runtime.XML object from debugger. And if I call alert(app...

How can I open a browser tab with Jetpack in Thunderbird?

This code will work with Jetpack in Firefox: jetpack.tabs.open("https://www.google.com/calendar"); How can I do the same in Thunderbird? (if I run this code there it gives me a "browserWindow is null" error) ...

Getting JSON Key from Value or Inverting JSON Data

Getting single key from Value I would like to do a backwards selection from the following JSON. I'd like to extract the abbreviation for a particular state. In this situation, the abbreviation is the key, and the value that I'm starting with is the value. Certainly I can loop through each value, comparing the value to my value, and sel...

What library emulates OpenGL in Javascript

I would like to put a texture on the surface of 3D models. I heard that there is a solution which allows to make it through OpenGL. ...

Setting up TinyMCE textbox element

On the web page I try to initialize TinyMCE for a specifice asp:textbox web control. This is the javascript in the header: tinyMCE.init({ mode: "exact", elements: '<% = txtBody.ClientID %>', The problem is that the txtBody control is generated inside template of DetailsView control: <asp:TemplateField HeaderText="B...

Accessing dynamic JavaScript content from onclick

I have read previous posts and used suggestions about firebug and selenium etc. I am still a newbie and am still pretty confused as how to implement this. I am trying to access URLs that appear when I click on a link. I have accessed the JavaScript code and the function just has a couple of parameters which I have no idea how to intercep...

Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft

I want to get the top and left values for a div on the screen. I have been using the code to calculate the top and left values. var total1 = 0; var total2 = 0; while(element){ total1+=element.offsetTop; total2+=element.offsetLeft; try{ element=element.offsetParent; }catch(E){ break; } } For the same DOM TREE this code is giving a per...

Finding the origin of HTTP request on a page

How can I figure out where a request is made in a javascript application? I'm debugging a large application which generates an incorrect HTTP request somewhere. I believe I haven't configured something properly with the API generating the request (Google Maps). If I could figure out where the request is made, then I could trace back to...

prettify highlightning in a PRE with white-space:nowrap is one line in IE

Hi, In Internet Explorer, a PRE with a style of white-space:nowrap is causing the code in the PRE to be in one single line when I use prettify (http://code.google.com/p/google-code-prettify/). Doesn't a <br/> is supposed to cause a new line in a PRE? I checked the HTML source generated by prettify after the page has loaded and it gener...

Select substring based on a string of options.

I have the following code // this text box can contain a URL such as: // http://vimeo.com/ // http://www.youtube.com/ // and so on. var text = $('#myTextBox').val(); var providers = "youtube|flickr|viddler|qik|revision3|hulu|vimeo"; if( text.match(providers).length > -1) { var selectedProvider = ???; } the match method looks i...

how to retrieve file type using jquery

I have two textboxes. One is a normal textbox and another 'input type="file"' when I click on the button I want a label to be updated with the textbox value and it's href pointing to whatever I have attached to the file type. How can this be done using jquery. Googled a lot but din't find any answer ...

Simple hash function (1 byte output from string input)

Hi folks, I'm looking for a simple hash algroithm that will give me one byte of output for a string input (the inputs will be RFC822 email addresses, if that helps). I'd like it to be simple, fast, and to magnify input differences (so two similar addresses have differnt outputs). (Yes, I am asking for a lot in one byte of output.) Id...

How might I populate an object property using a JSON-encoded server response?

How can i turn this: <? echo json_encode($myArrays); ?> ...into this: _rowData: [ { name: "Most Recent", view: "recentView" }, { name: "Most Popular", view: "popularView" }, { name: "Staff Picks", view: "staffView" } ], My script returns that ^, but i dont know how to put the data into the string, _rowData ? P.S. I am...

Ask whether the user is sure to leave the site (XHTML/JavaScript)

When a user leaves one page of my website, there should be a warning message which gives the user the option to stay on the page: "Are you sure that you want to close this page?" It doesn't matter if the next page is an internal or external page. I thought this could be done with the onUnload event handler, couldn't it? <body onunloa...

JSON element selection

my JSON objects look like this: [{"aid":"1","atitle":"Ameya R. Kadam"},{"aid":"2","atitle":"Amritpal Singh"},{"aid":"3","atitle":"Anwar Syed"},{"aid":"4","atitle":"Aratrika"},{"aid":"5","atitle":"Bharti Nagpal"}] As you can see the names are differentiated through their associated aid's. Now suppose I want to display the name stacked ...

Prototyping with a function assignment in Javascript

I have been trying some fundamentals in javascript and here is what I observed. I wrote a prototype modification method for Function object Function.prototype.method = function(name, func) { this.prototype[name] = func; return this; } function pirates(value) { console.log("I just throw away the value!!" + value); } pirates.m...

how can I override an anonymous javascript function attached to an eventlistener?

I found that a website does somewhat sneaky things. When you hover over a link, it shows you the real URL. WHen you click on it, it uses the click/mousedown event to rewrite the URL. I want to override that behaviour in firefox, So I fired up firebug to see what it does. On a mouse click, it executes a function called window.tgs. Easy,...