javascript

Let object "invoke" function in JavaScript

I wasn't sure of the title, but I hope you will be able to help me. I want to use kinda the same pattern that jQuery uses for their event handlers, like click/hover/blur etc, where you use this inside the event handler to get the object. How do I accomplish this? // The event handler var handler = function() { alert(this); // how...

Does Javascript string.toLowerCase() follow Unicode standards in case-conversions?

Hi! I'm creating a browser-based form verification script that checks if the input doesn't have any uppercase characters according to Unicode Standards. My definition of an uppercase character is a character that has a lowercase mapping. If a certain character in the input string doesn't have a lowercase or uppercase mapping (like chine...

How to transition between two SVG images?

Hi, I have a div with a background image set to an SVG image. I need to transition between two SVG images, how would I accomplish this? I am referring to CSS 3 transitions, but other solutions are also welcome. ...

CSS / JavaScript - content outside a element with overflow:hidden

Hi I have a container div element that has overflow:hidden on it. Unfortunately this property is required on it because of the way the site is made. Inside this div it's all the site content, including some tooltips. These tooltips are displayed with jQuery when you mouse over a link or something. The problem is that some of these too...

Auto trigger submit

Hi, I've been working on the following (with some very good help from users here at stackoverflow). It works brilliantly, but now I realise it needs to trigger when the page loads rather than on a trigger. I'm a newbie to client side, so would appreciate your help. <script language="Javascript">function checkjava(){return 1}</script>...

How to add JavaScript if the URL has a certain word ?

I want to add the the following jQuery to the following pages only. http://www.mywebsite.com/check-8.asp http://www.mywebsite.com/edit-8.asp http://www.mywebsite.com/cart-8.asp So this means I want to add it where URL string contains either check-8, cart-8 or edit-8. What is the best way with jQuery or JavaScript? var text = $('...

PHP/Javascript: Same input "id" in while

In my friends page, when you accept a user, it sends a ajax call: function MeYouFriendNB(confirm){ var c = confirm ? 'confirm' : 'ignore'; var fID = $('.fID').val(); $.ajax({ type: "POST", url: "misc/AddFriend.php", data: { mode: 'ajax', friend: c, uID : $('#uID'+fID).val(), fID : $('#fID'+fI...

Is it worth coding for users who may not have JavaScript enabled?

Possible Duplicates: How safe is it to assume that most users will have JS enabled? Is it reasonable to assume my visitors have javascript enabled? I'm worrying about this and don't know if I should be. ...

FileSystemObject

My script fly with IE8 when I instantiate the file system object: var fso = new ActiveXObject("Scripting.FileSystemObject"); alert("does not reach this point"); Any ideas? ...

how to fetch a web page content from google api

Hi, Is there any Google API to fetch a web page's content ? I know this can be done using Curl . Regards, Mithun ...

how to make auto pull down menu works with frameset?

i failed many times. it's only works once. loaded once only. when i go to other option, it's not work. i copied the script from: http://javascript.internet.com/navigation/menu-auto-frames.html . please trying the script, and check where's the missing script. tq. ...

simple document failing to work

Hi, I'm working on a simple script to pass the value " ...php?answer=1" if java is enabled. I've got this far ... <script language="text/javascript"> document.form.answer.value=1; </script> </head> <body> <form name="form" action="enabled_catch.php" method="get"> <input type="hidden" name="answer"> <input type="submit" value="click me"...

XulRunner javascript

Hi all! I have a some trouble with XUL. <window id="main_window" title="app" accelerated="true" width="300" minwidth="500" height="500" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt; <script src="chrome://app/content/js/run.js"></script> <browser id="main_browser_window" type="content" src="chrome://app/con...

Login PHP session after switch to SSL

I decided to invest a few hours in trying to secure my site with SSL. Got the server running alright but have hit a wall with my PHP $_SESSION. I understand the issue of passing session ids between HTTP and HTTPS, but that's not happening here (I think). The convoluted session sequence goes something like this: login.html: <form act...

Does Javascript have Java's Calendar helper class?

i'm trying to use the Java version of: Date d = new Date(2010, Calendar.AUGUST, 28); but in Javascript: var d = new Date(2010, ???, 28); i cannot find a helper class that contains month constants? Does the Java helper Calendar class exist in Javascript? ...

Does body onload happen before window.onload ?

Hi I'm working on the following. It basically passes ?answer=1 if js is enabled. It works until I add the onload argument (as I want this to happen without a user trigger). However adding onload appears to stop (the otherwise working) getElementById argument. Why is this happening? <script type="text/javascript"> window.onload = functi...

How to loop a sound without gaps in www site

I need this sound http://www.sound-effect.com/sounds1/noise/Static_Stereo.wav to play in background of my site all the time. Is it possible to do this without gaps? I understand that in most of the sites sound is annoying for users, but this site is exception. This sound is essential in this site. ...

JavaScript - Changing style when none exists

I have a function which wanders through the elements in a page and adjusts the font size function changebuttonsize (sz) { var z = document.body.getElementsByTagName("*"); for (var i=0; i<z.length; i++) { if (z[i].id=="BTSz") { z[i].style.fontSize = sz; } } } I use it to change the size of the following butt...

Sending ajax call when active?

Hey, i just noticed something on facebook.com, facebook was in my other tab, and i was browsing on SO, after a while i switched back to facebook.com and it like fades in new news in the wall. How did they make a script that knows when you are active again without clicking anywhere it shall refresh new messages etc. ? Just like facebook c...

Document.links empty after calling document.close

When you execute following example using Firefox 3: <html> <head> <script language="javascript" type="text/javascript"> <!-- function openWindow(){ var w = window.open('', 'otherWin', 'width=600,height=600'); w.document.write(document.getElementsByTagName("html")[0].innerHTML); w.document.close(); reportLinks(w....