javascript

JavaScript - Why does my asrnchronous download not download asynchronously?

I'm using the following Google Maps autload (asynchronous) to load asynchronous both Google Maps v3 and JQuery, like so: <script type="text/javascript" src="http://www.google.com/jsapi?autoload={ "modules":[ {name:"maps",version:3,other_params:"sensor=false"},{"name":"jquery","version":"1.4.2"},{"name":"jqueryui","version":"1.8.1"} ]}">...

jQuery/JavaScript: Trigger when preloaded

Hello there, jQuery has the .ready() function, but I am unsure whether this is what I need: I set a default background image in CSS (imange 1 out of 4), once document is loaded (images and all, not only DOM); I want to start preloading background image 2 out of 4. Once that is loaded, I want to fade image 1 into image 2. Then I want to...

Help creating a JavaScript mixin in Tapestry5?

I am creating a mixin which renders a javascript file when a textfield gains focus. I am new to the idea of mixins in Tapestry, and I am unsure of where to place my original javascript file which i wish to run when the textfield gains focus. The following is an example of my code: The Java mixin class: package asc.mixins; import org....

Executing curl from Javascript?

Is there a way to execute curl from Javascript? Thanks. ...

Is there a way to trigger inline javascript execution inside some div from jquery?

I have some container on a page with inline javascript. Is there a way to trigger its execution once again after it was initially triggered automatically on a page load? <div id="mydiv"> <script type='text/javascript'>alert("trigger me again");</script> </div> ...

Script tag in ASPX page is not written

I have an aspx page with the following code (partial and simplified): (beginning of page) <body id="body" runat="server"> <form id="form1" runat="server">some HTML</form> <script type="text/javascript"> window.addEvent('domready', function() { var x = "nothing"; <% if(someCondition){%> x = ...

JavaScript function causing all other functions not to work inside js file

In safari 4 and all explorer browsers, whenever I try to call a function inside a javascript file which contains this function below, that first function isn't called. So calling function1 will not work if function2 is inside the same .js file, explanation? Here is the code which makes the problem. Whenever I remove this function, ever...

Regular Expression to return the contents of a HTML tag received as a string of text

I have a string in my code that I receive that contains some html tags. It is not part of the HTML page being displayed so I cannot grab the html tag contents using the DOM (i.e. document.getElementById('tag id').firstChild.data); So, for example within the string of text would appear a tag like this: <span id='myQty'>12</span> My ...

Sending Javascript variables.

I have a page that allows a user to choose some things in a form and it will calculate the weight using javascript. It breaks it up into 5 variables that I need to send to another page. Originally I was just having it put the variable into a text box and then I was posting that text box. However I dont want to have 5 text boxes. So now I...

Ajax cache control

Hello, I am having a problem with ajax requests in Internet Explorer and in Chrome - I cannot bust the cache. Normal pages don't have the problem - it's just the ajax requests. I know that one workaround is to append a random query string variable to the end of the URL. However, I don't want to lose all the benefits of caching, I jus...

variable rowheight in slickGrid

Hi, I would like to provide variable row height depending upon the content size. is it possible in Slickgrid? Can you point me towards any examples. Thanks, ...

javascript - How to pass an argument in a function call?

function rp_marcadesmarcaFarm(valor) { FM_log(3, "marcadesmarcaFarm called = "+valor); for (i = 0; i < farmList.length; i++) { var arr = farmList[i].split("|"); var xy = arr[0].split(","); var fvillageId = xy2id(parseInt(xy[0]), parseInt(xy[1])); GM_setValue("farmAtivada_"+suffix...

Why are these methods public?

My javascript looks like the following. I don't understand why these methods are all public though? Something.RegisterNamespace("One.ABC"); (function(ABC) { ABC.SayHello = function() { alert('hello'); }; })(One.ABC); So now I can do: One.ABC.SayHello(); ...

Not very objective - please help

I am having trouble understanding the meaning and more importantly the concept of an object as it relates to jQuery. I understand the basics that its a collection of data that comes in two forms, properties and methods but I kind of get lost on how it works beyond that. Can anyone point me to some good tutorials that maybe helped you und...

What are the js recursion limits for Firefox, Chrome, Safari, IE, etc?

I've got some Javascript code which uses fairly deep recursion and I'd like to find out what the recursion limits in the various browsers are (i.e. the point at which the error "too much recursion" will happen). Anyone have any solid numbers on this, by version? ...

Using JavaScript in WordPress: throw all jQuery plugins in, or is there a way to conditionally load?

I'm relatively new with WordPress theming and JavaScript, though not incompetent with either. I'm looking to have a maximum of 10 jQuery plugins to go on the blog, but I'm wondering if there's a way to have them load only when needed, as I don't want any unnecessary loading for the users. Something similar in something I know a little ...

asp.net mvc. Inserting string data from model into javascript. best-practice

Hello everybody, I have to populate javascript code in html layout (hidden fields, method params) with string data from model. Html.Encode is not appropriate for my task because it encodes ' symbol, bypass : (that ruines object attributes declaration) and so on. I wrote static helper class that is used from View like this: alert('...

Javascript Getting Objects to Fallback to One Another

Here's a ugly bit of Javascript it would be nice to find a workaround. Javascript has no classes, and that is a good thing. But it implements fallback between objects in a rather ugly way. The foundational construct should be to have one object that, when a property fails to be found, it falls back to another object. So if we want a to...

Opening PDF String in new window with javascript

Hello, I have a formatted PDF string that looks like %PDF-1.73 0 obj<<< /Type /Group /S /Transparency /CS /DeviceRGB >> /Resources 2 0 R/Contents 4 0 R>> endobj4 0 obj<> streamx��R=o�0��+��=|vL�R���l�-��ځ,���Ge�JK����{���Y5�����Z˯k�vf�a��`G֢ۢ��Asf�z�ͼ��`%��aI#�!;�t���GD?!���<�����B�b�� ... 00000 n 0000000703 00000 n 0000000820 00000...

Javascript or CSS hover not working in Safari and Chrome

I have a problem with a script for a image gallery. The problem seems to only occur on Safari and Chrome, but if I refresh the page I get it to work correctly - weird! Correct function: The gallery has a top bar, which if you hover over it, it will display a caption. Below sits the main image. At the bottom there is another bar that is...