javascript

jQuery ajax success chaining Internet Explorer Issues

I have a jQuery ajax function that retrieves JSON data. In the success block I call another function to parse the data and update the page. At the end of this parsing/updating function a different ajax call is made. This works perfectly in all browsers except Internet Explorer (7 and 8). The problem is Internet explorer thinks the sc...

Page fully re-rendered event?

I'm altering the DOM tree in plain JS and need to know when the changes get fully rendered on screen (mostly care about document dimensions). window.onload=function(){ ss = document.styleSheets[0]; for(i = 0; i < ss.cssRules.length; i++) { ss.deleteRule(i) }; ss.addRule('p', 'color: red;') // ... many more // call so...

ie not firing ajax complete call on certain page

even with a piece of code like this $.get('getforums.php', function(data) { alert(data); }); works well in chrome, firefox, safari, opera but not this baby. tried everything, cleared cache, recreate this file in different editor, even make this file just echoed a 's', but no, it just don't like this file, works perfect on other fi...

How to select the first property with unknown name and first item from array in JSON

I actually have two questions, both are probably simple, but for some odd reason I cant figure it out... I've worked with JSON 100s of times before too! but here is the JSON in question: {"69256":{ "streaminfo":{ "stream_ID":"1025", "sourceowner_ID":"2", "sourceowner_avatar":"http:\/\/content.nozzlmedia.com\/images\/so...

how to make Regular expression into non-greedy ?

Hi everyone! I have made a Work with JQ. My Work is a string width a special character block begin and end of string. I want take the text in that special characters, i used regular expression for find in string, but how to make JQ find multi result when have two special character or more. My html here; <div id="container"> <div i...

jQuery document.ready + Asp.Net ContentPlaceholder cause Visual Studio intellisence problems

Hi! I want to execute JavaScript when document is ready without much syntax overhead. The idea is to use Site.Master and ContentPlaceholder: <script type="text/javascript"> $(document).ready(function () { <asp:ContentPlaceHolder ID="OnReadyScript" runat="server" /> }); </script> and in inherited pages just write plain...

Javascript function as a parameter to another function?

Hello there, I'm learning lots of javascript these days, and one of the things I'm not quite understanding is passing functions as parameters to other functions. I get the concept of doing such things, but I myself can't come up with any situations where this would be ideal. My question is: When do you want to have your javascript fun...

How to open div on center screen position ?

How to open div on center screen position ? ...

Are the outputs of javascript parsers of different browsers the same?

Suppose there is a piece of JavaScript code that is supported by different browsers, for example IE and Firefox. Would the JavaScript parsers of the different browsers generate the same output (i.e., the same AST)? ...

asp.net login controls droped error "object expected" when i click the "administer website" to debug

hello: i have just created a new empty website from visualstudio 2010, added an new webform and droped a login control into the page.when i click the tag "administer website" then try to open security->Use the security Setup Wizard to configure security step by step, the IE8 shows the error: "Object Expected". (tried to make a asp.net ...

JQuery drag and Drop

I wish to create an Interface to choose Multiple answers using Drag & Drop rather than CheckBox near to the answers. User can choose two types of answers (Real Answer and a Fake Answer). The User has Two Images (for Real & Fake) on the answer page. User can drag an Image and drop near to the selected answer. It is possible to change the ...

html post issue

i have the following html code : <FORM name=frmmail> <input id="dochtmlContent" type="hidden" name="dochtmlContent" value="oldValue"/> <script>document.dochtmlContent="newValue"</script> </FORM> and later on in a javascript function (which is called upn submit): alert(document.dochtmlContent); document.frmmail.method = ...

how can we prevent .exe type file upload in a website?

suppose we have a example.exe file. we first put that file in a new folder and then zip that folder with any zipping software, Can we prevent that zipped folder upload in a website???? how can we do that??????????? ...

new image makes http request even though cached?

I have a javascript slide show that creates the next slide dynamically and then moves it into view. Since the images are actually sprites, the src is transparent.png and the actual image is mapped via background:url(.. in css. Every time (well, most of the time) the script creates a new Element, Firefox makes an http request for transpa...

how to print background image?

I tried to print background image by enabling browser's 'print background image' option.But it shows me half of the image.What's the problem and how exactly I can solved that? Thanks. ...

Javascript Running slow in IE

Hi, Javascript is running extremely slow on IE on some pages in our site. Profiling seems to show that the following methods are taking the most time: (Method, count, inclusive time, exclusive time) JScript - window script block 2,332 237.98 184.98 getDimensions 4 33 33 eh 213 32 32 extend 446 30 30 tt_HideSrcTagsRecurs ...

jquery javascript question

Hello, var val = $("#desc").val(); // input box var val2 = $("#type").val(); // select box if((val=='') || (val2 == '')) { alert("err"); } else { // codes } when i select dropdown and not type anything on inputbox, the alert err still comes out? how to make it when dropdown is selected, it goes to else clause? ...

jquery sucess dropdown

hi, //codes success: function(html){ // this is for input box - working document.getElementById('val').value=''; $('#val').value=''; // how do i set it for dropdown box to reset after sucess? document.getElementById('val2').value=''; $('#val2').value=''; } Once user submit dropdown box, i need it to reset to value="...

Lightbox-style dialog shows below YouTube movie on Mac OS 10.6

This is a "but it works on my machine" one and could be tricky: I have a lightbox-style HTML dialog that shows a menu on top of a web page. It can be injected into any web page via a JavaScript bookmarklet. One of my users is trying to use it on YouTube.com with the result that the flash movie is rendered on top of the dialog (a div w...

xmlhttprequest responsetext coming for Accept header: text/xml , but server error for application/JSON

I have to get response text from a resourceindex page as JSON object. When I dont put a Accept header in the request, it shows me the xml response (i see it in an alert).. But I want the response as a JSON object.. What should I do. One solution would have been httpRequest.setRequestHeader('Accept', 'application/JSON'); but this give...