Is it possible to implement a QObject for use in QtScript which overloads [] to implement lazy array population?
I want to implement something like this:
var bar = foo["bar"];
and have the value be lazily calculated in C++ code. Is this possible?
...
Hi all:
I have a question in regards to unit testing jQuery's document.ready function().
Currently I have 2 scenarios in my code:
function myFunction()
{
$(document).ready(function() { ... });
}
And:
$(document).ready(function()
{
// some really long setup code here
});
I tried to write a unit test for the first scenario,...
I'm doing some basic exercises with dojo to learn its syntax and methods.
I've created a simplified example below for the purpose of learning chaining animations on a group of items.
Could anyone offer some feedback on the dojo code I have created? Am I utilising the correct library features in this circumstance? Which of the dojo opt...
I inherited a web site project that includes mootools.js (about 40k) in most of the scripts. However, I have not seen, intuitively, where it is being used and given the nature of this porject, ahem, I'm thinking it might not be being used at all!
I'm "under the gun" to ship this tonight (yup, it's a pre-Thanksgiving release). I have not...
Trying to find a way to automate the API from javascript comments.
...
From a question in this site I found the following code of romaintaz:
<script type="text/javascript">
function testField(field) {
var regExpr = new RegExp("^\d*\.?\d*$");
if (!regExpr.test(field.value)) {
// Case of error
field.value = "";
}
}
</script>
My question now is: How can I make this validator only ...
this is not a programming question as such but still...
does anyone know of a service / spider / crawler that can fetch javascript or CSS resources embedded through standard methods (or lazy loading, whatever it can cope with)
practical use for it: search for a unique piece of code from a class or function you've written and get a list...
I'm creating a popup window that has a beforeunload handler installed. When the "Close" file menu item is used to close the popup, the beforeunload handler is called twice, resulting in two "Are you sure you want to close this window?" messages appearing.
This is a bug with Firefox, and I've reported it here, but I still would like a wa...
Are there any easy ways to override the default behaviors of the geolocation api and just hard code your current location?
I think this would be useful for testing and for privacy reasons (providing fake location data)
I thought there was an add on for this but I can't seem to find one. Only option right now seems to be changing the a...
For security reason, i need to garantee that only web client running an specif web site can access the web service. I'm doing verification over the domain request only, but i need to do some more robust. I think is too easy to break my security check.
...
Hi All I have a pretty straight forward function
enableModule : function(moduleName){
var module = $('div#'+moduleName);
console.log('enabling '+moduleName);
console.time('animate');
module.animate({'opacity' : '1.0'}, 300, function(){console.timeEnd('animate');});
module.find('.disabled_sheild')....
For some weird reason i'm getting my confirm box coming up twice. here is my code:
$(".DeleteComment").live("click", function(){
var CommentID = $(this).attr("rel");
var confirm
if (!confirm('Are you sure you want to permanently delete this comment?')){
return false;
}else{
$(this).html("loading").css("colo...
I am trying to perform some computations on a server. For this, the client initially inputs some data which I am capturing through Javascript. Now, I would perhaps make a XMLHttpRequest to a server to send this data. Let's say the computation takes an hour and the client leaves the system or switches off the system.
In practice, I woul...
I am doing iphone web development and I've noticed that: gesture events can also be touch events, which means a touch event handler also fires up when there is a gesture event.
Any way that I can add specific event handler to gesture (not touch)? Or how can I know if this is a pure touch event or a pure gesture event?
...
I need a hand with my google maps code...
Basically what I want to do is display multiple addresses on a single map. I've got that part to work but I need to set-up the bounds and zoom so it zooms out/in and shows all the addresses in the map window...
My problem is after I run the setMapMarker() function in the load() function, I nee...
I'm experiencing an error that I haven't been able to find any mention of anywhere. I'm developing an AJAX-enabled WCF web service with ASP.NET. In my ASP.NET master page's , I included the json.js file, copied fresh from json.org. When I run the page, it fails (VS 2008 catches a Javascript exception) on the first line of code in json.js...
Hello,
I've created a simple jQuery slider for my website, and I was wondering if it's possible to assign a URL for each pane.
For example /index.html#about will slide to the about tab by default.
Many thanks for your help and responses.
...
I have made a jQuery based widget which is configured a bit like this:
jQuery("#foo").widget("service", {
output : "test_output_field",
parameters : {'format' : 'json',
'limit' : 20,
'services' : {'service1' : {},
'service2' : {'language' : 'en', 'type' : 'solid', 'parent' : 'father'},
'service3' : {...
I understand what closures are, but I am having some trouble grokking exactly what the term closure refers to. I have seen the term used in many websites, but rarely do they agree on the actual definition of it.
Is it the variables that are kept on the stack frame?
Is it the function that is being returned?
Is it the scope of the oute...
In my JSP i am using a custom tag <showDateFormat/>
like:
Date From:<showDateFormat/>
and in my common.js file i am having
function addDateFormatInfo(){
var dateFormatHolder = document.getElementsByTagName("showDateFormat");
if ( dateFormatHolder ){
for ( i = 0 ; i < dateFormatHolder.length; i++ ){
dateFormatH...