Category Archives: HTML | CSS | JS

Make games with Construct2

Recently I was looking for HTML5 game frameworks because in the future I want to develop what I think would be a very cool game.
And while I was looking I found this application Construct2.

Construct2

This an application that allows users to make games just by drag and drop objects around, add behaviors to them, and make everything come alive with events!

Simple right.

If you want to learn more about Construct2 I really recommend that you see this video because it teach very quickly how to create simple games like Flappy Birds:

Now what is motivating me to test this application is the export options:
Construct2-export

Not only it exports to HTML5 but also to mobile devices and much much more.

I think this deserves test.

Digg thisBuffer this pageShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrTweet about this on Twitter

Load Jquery in Chrome developer console

If you for some reason need to load chrome in the developer console and that page doesn’t include Jquery this is what you will need to do:

For http page:

var scriptElem = document.createElement(‘script’);
scriptElem.src = “http://code.jquery.com/jquery.js”;
document.getElementsByTagName(‘head’)[0].appendChild(scriptElem);

 

For https page:

var scriptElem = document.createElement(‘script’);
scriptElem.src = “https://code.jquery.com/jquery.js”;
document.getElementsByTagName(‘head’)[0].appendChild(scriptElem);

 

Now you can start Jquery.

 

jquery-in-chrome-console

Digg thisBuffer this pageShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrTweet about this on Twitter

Chrome sync passwords

Recently I had to sync every thing between chrome browsers. I already knew that In chrome you can sync because you have an option in preferences\personal stuff.

Chrome Preferences

 

But this options doesn’t allow sync passwords… well it does, that option is hidden and you will need to execute chrome with a special switch.
That switch is –enable-sync-passwords
To execute chrome with this swirch you need first to locate chrome executable:
Windows Vista – C:\Users\“your_username”\AppData\Local\Google\Chrome\
    Ex: C:\Users\pedro\AppData\Local\Google\Chrome\
Windows 7: C:\Users\“your_username”\AppData\Local\Google\Chrome\
    Ex: C:\Users\pedro\AppData\Local\Google\Chrome\
Windows XP: C:\Documents and Settings\”your_username”\Local Settings\Application Data\Google\Chrome\
    Ex: C:\Documents and Settings\pedro\Local Settings\Application Data\Google\Chrome\
Linux: /opt/google/chrome
 
Now you will need to go to the command line and execute chrome with switch –enable-sync-passwords
Ex: google-chrome –enable-sync-passwords
Now you will need to go to preferences\personal stuff and you click on Set Up Sync… enter you account and then your will have a screen where you can choose to sync your passwords
Chrome Preferences Passwords
Check here for more information about sync.
Digg thisBuffer this pageShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrTweet about this on Twitter

Chrome and cross-domain requests

In chrome, if you are having this error:
“Unsafe JavaScript attempt to access frame with URL “url1” from frame with URL “url2″. Domains, protocols and ports must match.”
You should know that this error happen when you have cross-domain requests.
In chrome you can allow cross-domain requests during testing by running chrome with the –disable-web-security command line option.
ex:
“C:\Documents and Settings\User\Local Settings\Application Data\Google\Chrome\Application\chrome.exe” –disable-web-security
Digg thisBuffer this pageShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrTweet about this on Twitter

JavaScript single trailing comma as the last item

The single trailing command in last item of an array was first introduced in JScript 5.8. JScript 5.7 doesn’t support this extention.

var myVar = [1,2,3,4, ];
While many browsers support this extention the IE < 9 doesn’t. If you want your site to work with IE < 9 then you shouldn’t use this extention because you will probably have errors or wrong values.

Corrected Issues

Trailing commas in array literals added to the array’s length

Example

var len = [1,2,3,].length;

alert(len); //should be 3, IE8 says 4

If you want to read more about this in the standard document check this link
Digg thisBuffer this pageShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrTweet about this on Twitter