javascript

Error: '$viewMap[...]' is null or not an object

My jQuery/Javascript knowledge is limited I'm afraid. I have a "how did you hear about us" dropdown on a form. However, I get the following Javascript error on change: Error: '$viewMap[...]' is null or not an object My dropdown looks like this: <select onchange="setSourceID(this.value)" name="sourceID" id="sourceID" class="required"> ...

[JQUERY] Triggering a draggable on mousedown.

Hi guys, This is my problem i'm trying to create a event to trigger a draggable. Here is what i already tried. <div id="ecard-canvas"> <div id="ecard-border"></div> <img id="ecard-image" src="images/content/girl.jpg" alt="chick"/> </div> and the JS. $('#ecard-image').draggable(); $('#ecard-border').mousedown( function(event...

Safari: Disable form-submit on Enter?

Hello! Following problem: On my site, I have two forms. One for login and one for main data. I have only one submit button in the mainform. The loginform is submitted via js on mainform submit. This works fine. But in Safari I can press Enter while my focus is inside the login form. This will send the login form without the mainform, s...

ajax solr question

i followed the ajax solr tutorial, and in step one i wrote this code. header.php: <script type="text/javascript" src="static/js/ajax-solr/core/Core.js"></script> <script type="text/javascript" src="static/js/ajax-solr/core/AbstractManager.js"></script> <script type="text/javascript" src="static/js/ajax-solr/managers/Manager.jquery.js">...

how to get base url in js file

how to get base url in js file with javascript? ...

Is it theoretically impossible to get the size of a file that is going to be uploaded using Javascript?

How about <script language="JavaScript"> function A() { var oas = new ActiveXObject("Scripting.FileSystemObject"); var d = document.a.b.value; var e = oas.getFile(d); var f = e.size; var mb=f/(1024); alert(mb + "kilo bytes"); } </script> ...

solr responses to webbrowser URL but not from javascript code?

I have set up Solr and it's working because I can see the search results when I'm typing: http://localhost:8983/solr/select?q=*:* in the browser. However, it doesn't work when I try to contact it through ajax-javascript/jquery. I've tried with $.get, $.post and with the ajax-solr code: var Manager; (function ($) { $(function () ...

getting the HEAD element from overlay.js firefox plugin

I have a lightwiehgt plugin to firefox which needs to inject a script into the HTML. The code looks like this: var head = document.getElementsByTagName("head")[0]; var newscrpt; newscrpt = document.createElement('script'); newscrpt.type = "text/javascript" ; newscrpt.src = "http://blabla.com/..."; newscrpt = head.appendChild(news...

Change background repeat image with JavaScript

I'm trying to create a script that changes the repeated background image of an element, on the mouseover event. Unfortunately it does not work properly. I have found several possible ways to do this with JavaScript but none of them has worked for me. How can I solve this problem? The following piece of code is not working properly: ...

How can I get lat/lang with Geocode?

I have an address, and now I need to retrieve the Lat / Lang coordinates. At Google, they only have good examples for V2 and not V3. I want to do the following: var myLatLAng = getLatLang(adress); How can I modify this code to make that happend? function showAddress(address) { geocoder.getLatLng( address, function(point) {...

Why do I get "map.set_center is not a function" ?

Hi. This code have been working until I updated last night. The code works perfectly on my localhost, but I get an error on my test server. The error message (from Firebug) is "map.set_center is not a function". So why is this not working on my server any more? function googleMapInit() { if (jQuery('#map_canvas').length ...

replace input with javascript

Hello everybody I'm trying to replace the 'text' input type to 'password' . And it works with following code : function replaceT(obj){ var newO=document.createElement('input'); newO.setAttribute('type','password'); newO.setAttribute('name',obj.getAttribute('name')); obj.parentNode.replaceChild(newO,obj); ne...

Chickenfoot JS question

Hello ppl, I am trying to make firefox automatically visit a set of webpages and report to me somehow how much it took to load each page. My best option so far seems to be the ChickenFoot extension. The following program however always outputs the same load time (3 milliseconds): function end_timer(start){ stop = new Date() out...

how to determine which serverside Button click in Client Side javascript?

How to determine which serverside Button click in Client Side javascript? There are many Buttons in the form. function onMyClicked() { var btn = ??; if (btn == 'IDDelete') { var result = confirm("........ "); if (result){ xxxxx } else close(); } ...

Slideshow on UIWebview?

Is it possible to run a slideshow in UIWebview control on iPhone? When I open picasa on my UIWebview it does not show the top bar with slideshow button, as it shows in Safari. Please help. ...

ASP.NET 3.5 , JavaScript and Skype4COM Problem

hey all, i'm trying to access Skype.ActiveCalls Collection from JavaScript, i can access some of the properties like (count) on runtime. while i've trying to debug the code i've noticed a strange problem, i can see all properties and methods of element without any direct access (Skype.ActiveCalls[0]), but when i trying to do so (on de...

Parsing responseXML via AJAX POST

Hello I'm trying to develop a small AJAX program. XML I get from the server in responseXML. <?xml version="1.0"?> <serverResponse><resultaat>1</resultaat></serverResponse> If I try to retrieve the "resultaat" node and its content using this code : var serverResponse = mailObject.responseXML; var resultaatXML = serverResponse.getEle...

Architecture of player hand in JavaScript card game

So, i'm attempting simple card game. I have player "class" with draw function, and public members deck and hand, both are Arrays. I need to draw a card from the deck, put it in hand and show it in player "hand" area. I'm concerned about the way I do "flip" and "play" buttons (through closures). Here is the code: littlegame.player.prot...

HTML/CSS/JS: How to make an illusion of a textarea with line numbers?

I want to have a textarea which displays line numbers on the left. Wrap should be set to "off" (so that horizontal scrolling is available). I want to have my page as a single self-contained .html file (there will be no graphics), so I'd like to avoid any 3rd party frameworks. Which way should I go? How would you do this? ...

Why does this Java applet crash and close IE6?

I am using the following Java Applet to get the full file path of a file that is to be uploaded: SVN LittleShoot. The thing is, the applet is initialized and it seems to be running in IE6 - but when I call one of the functions from JavaScript to the applet to open the file dialog box the browser crashes and closes itself just the dialog...