javascript

Javascript Execution Order in IE6

Aren't Javascript blocks supposed to execute in the order that they are placed on the page? IE6 doesn't seem to follow that rule in some situations. My page basically looks like this: <html> <head> <title>Widget Sandbox</title> <script type="text/javascript" src="http://domain2.com/script.js"&gt;&lt;/script&gt; </head> <body> ...

Ajax Binary Response

Hi I'm wondering if there's anyway to stream a binary response in AJAX? This would be an ultimate solution otherwise I would need to realize the binary image to a file then stream that file to the user with a different URL. new Ajax.Request('/viewImage?id=123', { // request returns a binary image inputstream onSuccess: function(tra...

Javascript: message by login

Hello, i have this chatbox, and when users login i want it to send a message like this: Admin: User is online I really want to use a javascript code for this, because i can work with it quite good. I already have some example, but the problem here is that it does not do something until it is called to do it's function. THATS what ...

Javascript: Form filling

Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1(); } Is this correct? Especially i want to know if i did function onLine(code,nn) (2 different values) correct. Can someone say so? EDIT: ...

JavaScript iframe busting

In certain conditions, I have a web page that gets opened in an iframe. When it's loaded into that iframe, I need it to set the window location to a resource to download a file (all of this in an attempt to make an update for a GreaseMonkey script... all legit, btw). Unfortunately, when I do: top.location.href = "http://userscripts.org/...

Combining two bookmarklets

Yesterday I discovered Bookmarklets and am totally in love. I wrote several to reduce the number of clicks for a few common tasks on my favorite websites. What I would like to do now, if possible, is to combine the actions of two of these bookmarklets into one single script/link. The current set up is as follows: Bookmarklet 1 (B1) pe...

Jquery - Add a dynamic class to another DIV

OK, perhaps the title doesnt best explain what im trying to achive but if I can explain better hopefully someone can help me out: Im using the following code to select the text held within <a> and add it as the class of that element: $(".nav a").each(function () { var self = $(this); self.addClass(self.text()); }); So for instanc...

Using special Chars in Firefox and IE, are being encoded by the browser differently

Hi guys, I've got a multilingual site, that allows users to input text to search a form field, but the text goes through Javascript before heading off to the backend. Special chars like "欢" are being properly handled in Firefox, but not in any version of IE. Can someone help me understand what's going on? Thanks! ...

DHTMLX : Known problems with IE?

Are there any DHTMLX users out there? We have an app that is being developed that renders fine in Firefox and Chrome, but is suffering greatly under IE. Any thoughts? Copied from IE detailed error diaglog box: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1....

Traverse XML to get node value

Hi, How can I traverse this XML to get the node value Mark Test 1. <gallery_index> <gallery id="0"> <property id="name"><![CDATA[Mark Test 1]]></property> </gallery> <gallery id="1"> <property id="name"><![CDATA[Mark Test 2]]></property> </ga...

disable asp.net validator using jquery

Hi, I am trying to disable validators using jquery. I have already looked http://stackoverflow.com/questions/400346/disable-asp-net-validators-with-javascript and couple of others doing the same. It seems be working but its breaking. My code: $('.c_MyValdiators').each(function() { var x = $(this).attr('id'); var y = doc...

styleWithCSS for IE

I'm using a rich text editor and when I click on the indent, it inserts a tag. I ran execCommand('styleWithCSS', false, true); and that made it do the indent using styling. Unforntunately, this only work in firefox and not IE. Does anyone have a solution for getting it to use styling in IE? ...

IE6 problem with dynamically adjusting the height of a div

All, Here's what I'm trying to accomplish. I have a Flash SWF that's embedded in a DIV. Depending on the user's interactions with that SWF, I'd like to dynamically adjust the height of the SWF. The SWF itself is 1200 pixels tall. By default, the DIV is 690 pixels tall, so the lower part of the SWF is clipped (which is the behavior I w...

Getting the value of text from a text object in JavaScript

I have an HTML file which contains the following line: <div><img src="img1.gif"><br>My Text</div> I'm trying to select the phrase "My Text" using JavaScript so I can change it. I'm able to get the object that contains the text by using lastChild, but can't figure out how to get the value of the text itself. ...

What is the 'new' keyword in JavaScript?

What exactly is the new keyword in JavaScript? Javascript is not a object oriented programming languges and thebefore there are no classes, so it's probably not for creating instances of objects... ...

Auto Submitting a Form

I am fooling around with Authorize.net and I have a problem I'm hoping someone could help me out with. Basically I have a page which I have a form on that has all the pertinent information to send to Authorize.net for a purchase. All a user has to do is click a button on the page and it POSTS all the info to get them to Authnet's hoste...

disabling ASP.NEt Validtor such that its disabled on postback

I am trying to disable ASP.Net Validator such that its disabled on postback. I am disabling the validator on client side using $('.c_MyValidator').each(function() { ValidatorEnable(document.getElementById($(this).attr('id')), false); }); but when the page postbacks, my page is still invalid. I am in UserControl (.ascx) so no ov...

scriptkiddie flooding my website with this snippit

hey, someone outthere is trying to flood my website with some script. luckly my application caught it i just wanna know what this code is doing <script> <!-- document.write(unescape("<?php //================================= // // scan inb0x hotmail v3.0 // // coded by FilhOte_Ccs and LOST // re-c0d3d by delet // // //================...

Getting the value from key in a dictionary that is nearest to a given number using JavaScript

I have a dictionary (keys are integers, values are float). I would now ask the dictionary for the value of the key that is > than the given number but < than the next greater key. Example: dict = {100: 0.0035, 150: 0.0024, 200: 0.0019}. i give 122, it should give me 0.0035 i give 333, it should give me 0.0019 i give 200, it should ...

To execute Flex cleanup function when browser is closed by user

I have a Flex client application. I need a clean up function to run in Flex when the user closes the browser. I found the following solution on the net, but it only works half-way for me. How could I fix it? Thanks in advance for any responses! Symptoms CustomEvent triggered, but not executed. >> EventHandler for CustomEvent.SEN...