Profile cover photo
Profile photo
Damien Golding
56 followers -
English man in Japan solving problems
English man in Japan solving problems

56 followers
About
Posts

Am I correct in thinking that long chained variables have more references to go through making them slower? No automatic optimizations made by the JavaScript engine?
In the below I am guessing that the engine works by(get GAME, get WORLD, get currentGame, get GAME[WORLD.currentGame], get GAME[WORLD.currentGame].party get GAME[WORLD.currentGame].party.length)

See below:

------------This:
    for(var i=0; i<GAME[WORLD.currentGame].party.length; i++)
    {
        
    }
-------------vs:
var party=GAME[WORLD.currentGame].party;
    for(var i=0; i<party.length; i++)
    {
       
    }

Should I be worried about using jQuery in heavy Web apps? and if so, is there any ways to use jQuery and prevent slowdown?

*I am making a HTML5 game and it is getting larger and larger. I am considering using jQuery for certain layout aspects, but the code is already large and a lot of the issues are around keeping the game running at a high speed.

Post has attachment
I am trying to get a stored list of object names and overwriting them with loaded data.
The below is not working and I can see why, but not sure how to get around it.
Any advice would be much appreciated. Regards.

Ignore the console logging : /

function loadDataFromJSON(json)
{
    var i=0;
    console.log(json);
    for(var obj in json)
    {
        
        var object=eval(MAKER.saveList.objects[i]);
        
        object=json[obj];
        
        console.log(object);
        console.log(MAKER.saveList.objects[i]);
        console.log(i);
        i++;
        if(i>100){return false;} //test to get out when bugged??
    }
}

What's a good free tool for Web development(specifically JavaScript)
Ideally would have recommending features(Type in console. and log etc. would be shown). I like that part of the Chrome console but is not suitable for Web development.

Regards

How do I get an object with a string?
Example:
for(var obj in window){if(obj=="navigator"){var ref=navigator;}} alert(ref.userAgent);

Is there any way to get all supported HTML elements/info in JavaScript?

Something I have never heard of so probably doesn't exist, and HTML is pretty much XML, but just in case, if there is a list of HTML elements stored somewhere in JavaScript it would be useful for development purposes.
I could quickly test whether canvas is supported or new HTML 5 elements are supported, etc.

Thanks

Can a string be sent to a function without using quotation marks?

This is a security based question. A function taking user input does not accept single and double quotations.
There is one function that could leak client data in theory only if a string could be sent.
The function like: specialFunction("functionName"); would be dangerous if functionName can be passed without the use of quotations. Is this possible?

I was thinking something similar to below:

var t =encodingNumberToString(1234567890);
specialFunction(t);

Thanks

Post has attachment
Damien Golding commented on a post on Blogger.
 “virtual field trips” ...
I'm sorry, this is sad.
People can't experience everything from their computer.
I am already sick of people not being convinced they are where they want to get to unless Google Maps on their smartphone says so. This is taking it a step further. Going somewhere and doing something is enjoyable, watching a computer screen all day is not.
Add a comment...

Hi, ideally this is for Windows 7(Windows 8 ok). Does anyone know a good tool for testing the time for execution and memory used for an application?

Ideally, I want to get memory usage and time data per application, process and thread.

I got a lot of unrelated software when searching for it.
Any help would be much appreciated.

Regards

Is there any risk of script injection when using user variables for setAttribute (JavaScript)?

I  tried using the bottom javascript on the shown div in Chrome web inspector, and it in the elements tab it seemed to have the right syntax to add the onclick event but it was not working. Is this a concern?

<div id="check"></div>
document.getElementById("check").setAttribute("style","background-color:skyBlue; width:50px; height:50px;\" onclick=\"console.log('test')");
Wait while more posts are being loaded