javascript

HTTP request with Windows script host (.hta)

I can't believe I'm stuck here, but I can't seem to make a simple HTTP request using Windows script host or simple .hta file. This is my code: <script language="Javascript"> window.onload = function() { var http = CreateObject("Microsoft.XmlHttp"); }; </script> When I start the .hta file I get a JavaScript error saying something ...

How to retrive GET or POST via JavaScript?

How to retrive get or post via javascript only? and not php. Is it possible? ...

how do implemant a remote login using json?

i have an api for users to log in, http://api.example.com/user_login, this is what i need to do: send the entered password and username to the api and request verifaction using json get a response using json, if successfull create a cookie and redirect to secured area! sorry im a weak javascript program! thanks ...

Good Coding: modularized js files or one big js file?

Just want to ask the gurus out there about this. I know that CSS files are better merged instead of separated into a zillion files. Does js work the same way? Here's a few points I currently know(or believe...so you can point something out if my belief/understanding is wrong): i know that js is better modularized for easier maintenance...

HTML File Input - Set allowed extensions and event for selected file

Hi all, Im trying to make a file input field have the following extensions only ".zip,.rar,.tar,.tar.gz" and i also want to trap event for when file has been selected and dialog has closed. any help ...

Javascript window.print with page setup

I am using window.print method to print a coupon. I want to change the page setup options. In page setup options, I want 2 things: Print background(color and images) - it will be checked. Shrink to fit page width - it will be unchecked. How can I do that? ...

Dropdown css/javascript boxes

Hi, I've found some solutions for custom drawn dropdown boxes to replace the HTML select element, namely the jquery-image-dropdown solution. However, how can I get a box which requires a click to open, and overdraws the selected item at the top, as at: http://www.xero.com/ Sorry if that's a bit confusing, essentially I'm looking for a...

Is it safe to merge several JavaScript files into one?

I'm developing a dynamic website using jQuery and I have found several jQuery plugins to be very helpful when doing that. Of course, for each plugin I add, there is another script to load when the page loads. I know that for pages to be quick to load, smaller and/or fewer resources is better. Is it safe to just merge all those jQuery p...

which better ? jquery and YUI

hi all which one am i use jquery and YUI. which one is better jquery and YUI or another javascript library or framework ...

Place an info bubble from right to left when it has no place in the browser window?

Hello, someone would have a script idea to place an info bubble from right to left when it has no place in the browser window? thank you for your answers ... My script // Detection du navigateur ns4 = (document.layers)? true:false; ie4 = (document.all)? true:false; // Decallage de l'infobulle par rapport au pointeur en X et en Y (en p...

Javascript for loop, index variable in function

Hello, I'm trying to figure out how to generate functions inside for loop. I have: for (var i = fir_0_f.length - 1; i >= 0; i--){ var next = i+1; var N = i; // Attemps //goal0_[i](next,N); //eval('goal0_'+i+'('+next+', '+N+')'); }; Have done also some searching. [] expects a string, eval() is a B.A.D practice. Is t...

Problem in indexOf in javascript

I want to find out if a variable value contains in second string. My code is if (ext.indexOf(FileUploadval.substring(FileUploadval.lastIndexOf('.') + 1)) == -1) { } where ext have value pdf,doc,dox,xls,xlsx,ppt,pptx and when i try xls or xlsx file it goes in if condition but when i try doc or pdf it doesnot go in if condition. what ca...

Opening modal dialog window is not working in Chrome

Response To: http://stackoverflow.com/questions/2144921/opening-popup-window-is-not-working-in-firefox-and-google-chrome Hi,I have similar code in above question.My code works fine in IE. this.parent.window.showModalDialog('Counter.aspx', '', 'dialogHeight:170px;dialogWidth:150px;status:no;scroll:no;edge:sunken;toolbar:0;center:on;hel...

javascript / Jquery .slideToggle - page does not scroll with content

Hi guys, I am using .slideToggle - Jquery to create an accordion and It works so far. However, When div#slickbox goes down or up the page does not scroll with it. The page maintain scroll position. I have 2 huge images(700px x 1300px) inside div#slickbox. I want to scroll the page with the content, down & up. How can I do this? ...

Change margin value on table with value from a variable with jQuery?

Hi, I select some tables using this: $('.StatusDateTable').each(function() { var statusLight = $(this).find(".StatusLight").attr("src"); statusLight = statusLight.substring(33).slice(0,-9); if (statusLight == "Blue") { var columns = Math.abs((start - end)-1); var columnWidth = 40; var marginRight = Math.abs(columnWidth * c...

I have a problem with string.match(part) (javascript)

var string = $.trim("How are you ? are you fine ?"); var part = $.trim("How are you ? are you fine ?"); var SearchResult = string.match(part); if (SearchResult != null && part!="") { alert("hello1"); } string = $.trim("How are you ? a"); part = $.trim("How are you ? a"); SearchResult = string.match(part); if (SearchResult != nu...

How to create Digg's Sliding Input Box?

Hi, How do they achieve that nice sliding input box? All I notice is that, their form margin is changing when you paste something. Do they use any plugin for jQuery? Any idea? ...

How to close internet explorer window on Windows CE 5.0

Hello, is there a way to close IE in Windows CE, I was try window.close(), self.close(), ... and it did not work. I was searching long for the answer, but have found nothing, a last I am asking here for help, if anyone has come to this issue. Thanks for any reply. ...

How to add javascript file in <head> in this condition?

Only if form action is /?cms_mode=edit <body id="home"> <form method="post" action="/?cms_mode=edit" id="main"> </form> </body> then a js file edit.js should be added into head, otherwise not. <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="main.js"></script> <script type="...

Can I write HTML code to Window.showModalDialog() ?

I use : Window.showModalDialog(...) to open a dialog window, I want show some HTML code in this window, but I don't have a file. (Can't use URL to visit) like show "hello world!" in this dialog window. Can I do it? ...