javascript

JavaScript (Rhino) use library or include other scripts

In JDK6, is there a way to load multiple scripts, each in a file, and have the one script reference a method of another script? Sort of like "include"? ...

Page to obtain browser and connection information.

We write software as a service solutions using ASP.NET and C#. Occasionally a client may have an issue due to a specific browser setting / nuance. Or that they are behind an unknown proxy server. They may also be reporting issues that are actually related to localised bandwidth problems. We're trying to put together a test page that pe...

HTML iframes and javascript

I have two iframes and each iframe show two different html pages. Both html pages refer to a common javascript file which contains a global variable. If I set the value of that global variable in one frame during html page load. Will the value be accessible using the same global variable to another iframe html page? why or why not? ...

Cache AJAX requests

I am sending AJAX GET-requests to a PHP application and would like to cache the request returns for later use. Since I am using GET this should be possible because different requests request different URLs (e.g. getHTML.php?page=2 and getHTML.php?page=5). What headers do I need to declare in the PHP-application to make the clients brow...

Why is javascript unable to get asp:Label innerText?

I have two labels: username and email. I use them to retrieve their content and pass them as method parameters. var lblEmail = $get('<%= lblEmail.ClientID %>'); var email = lblEmail.innerText; var lblUsername = '<%= lblUsername.ClientID %>'; var username = lblUsername.innerText; The email label is defined in the same way as username ...

Problems simulating click of ASP.NET button.

I have some code like this <asp:Button ID="cancelDummyButt" runat="server" CausesValidation="False" Text="cancel" onclick="cancelDummyButt_Click" Enabled="True" /> (Javascript:) buttid = '<%=cancelDummyButt.ClientID.ToString%>'; eltoclick = document.getElementById(buttid); eltoclick.click(); The server-side code is not called....

How does __proto__ differ from constructor.prototype?

Hi, if I have: function Gadget(name, color) { this.name = name; this.color = color; } Gadget.prototype.rating = 3 var newtoy = new Gadget("webcam", "black") newtoy.constructor.prototype.constructor.prototype.constructor.prototype it will returns always the object with rating = 3 but if I do newtoy.__proto__.__proto__.__prot...

Image response via POST

Hi, I am getting an image via a post request. How do I show the same on web using javascript. Is it possible to handle binary data using javascript? ...

Add HTML element - textarea dynamically using Javascript

I know it is possible to add/remove HTML elements dynamically to a web page using Javascript. I was wondering is the following possible- My coldfusion web page has a two column table and the last row of the table has a link in the first column and the second column is blank. When user hits that link, a textarea shows up in the second co...

Resize and repositon div using javascript

I'm trying to do a simple resize and reposition of a div element that shows a ajax loading image. The content it loads can change size, so I want the div element to resize to be the size of the parent, which in this case is a table dimension with the id "thEngineCategories". function resize_divProgress() { var control = document.ge...

Ajax call not responding on repeated request

I have a page with a dropdown. The onchange event calls a Javascript function (below) that includes an Ajax block that retrieves data and populates a TEXTAREA. On the surface, everything works. I can select any item in the list with no problems. However, if I select an item that has previously been selected, the Ajax call appears to ...

Get innerHTML value from dynamically generated textbox (in javascript)

I'm using javascript to dynamically generate a dialogue box (it's a div element), containing a textbox and a submit button. I plan on submitting the value in the textbox to another page using AJAX. THE PROBLEM: I can generate my textbox just fine, but I can't get the value from it. innerHTML comes back blank every time. I'm not sure ...

Determining if a marker is visible in Google Maps

I am developing a Google Maps application and I've run into this problem. I need to remove all markers which are out of bounds from the map. Is there any simple way of doing this, besides keeping an array and looking at the latlng of each marker? I cannot use MarkerManager because I have way too many points. I don't want to use clearO...

Strange Crash with FckEditor IE and Image Moving

Hi, We have used FCKEditor for a long time and been very happy with it. Just recently though a new problem has occurred. If we insert an image into html and save it, then fine. If we then move the image around inside the the text and re-save (i.e. Get the html from the control for saving to a db) then IE crashes (FF does not of course)...

Firebug - Breakpoint doesn't hit

I am setting breakpoints in an external JS file and I haven't been able to get Firebug hit the breakpoint in a consistent way. It works sometimes but most of the times it doesn't. The only way I can get it to work is by switching on "Break on all errors" I have used the debugger; statement as well without any luck. ...

Javascript / PHP cookie serialization methods?

I have a form which I would like to store the values of in a cookie so the user doesn't have to re-enter the form every visit. (The form is a few selects to filter search results.) I would like for the cookie serialization to easily be readable from javascript (obviously to set the form onLoad), but I'd also like to be able to read the ...

get the last element of a splitted string array in javascript

I need to get the last element of the splitted array with multiple seperators. if there's no array it should return the string the seperators are "commas" and "space" if the string is "how,are you doing, today?" it should return "today?" if the input were "hello" the output should be "hello" how can i do this in javascript DUPE: htt...

I don't understand this Code

I do not understand this code snippet : function ms(){ var plc=unescape('". unescape( '\x43\x43\x43\x43\n.............\xEF'. $URL).CollectGarbage(); if (mf)return(0); mf=1; var hsta=0x0c0c0c0c,hbs=0x100000,pl=plc.length*2,sss=hbs-(pl+0x38); var ss=gss(addr(hsta),sss),hb=(hsta-hbs)/hbs; for(i=0;i<hb;i++) m[...

How to have jQuery restrict file types on upload?

I would like to have jQuery limit a file upload feild to only jpg/jpeg, png, and gif. I am doing backend checking with php already. I am running my submit button through a javascript function already so I really just need to know how to check for the filetypes before submit or alert. Thanks! ...

Do you know any tools to remove badware, malware from my website which google blocks?

I have a website which google blocked because it had badware i removed the viruses from the server and its completely clean now, the problem that this virus changed in the html, js asp files in the site and added hidden iframes and strange scripts, i removed all what i found in the diles, but the website is toooo big, so any one have any...