Click here to Skip to main content
15,884,838 members
Articles / Web Development / HTML5
Tip/Trick

Custom jQuery for Windows 8

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
25 Oct 2012CPOL 11.1K   2   1
jQuery customised version to be used with Windows 8.

Introduction

With Windows 8 we get an ability to write HTML5 apps in JavaScript. With JavaScript comes a vast library of code already written for we. jQuery is one such useful library. jQuery can run under WinRT and apps will work fine while development. But none of the apps will get approved on the marketplace because jquery uses some code which seems malicious to windows 8 testers. For example Dynamic HTML injection. Thus i have created a customized version  of jQuery which passes windows 8 test. 

Using the code 

Step 1: Include jqueryWin8.js file in your project. 

Step 2: Type this <div> in your HTML file 

HTML
<div id="test"><link/><table></table><a href='http://www.codeproject.com/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/></div> 

Include jqueryWin8.js in your HTML file. 

HTML
<script type="text/javascript" src="js/jqueryWin8.js"></script>   

Step 3: Use jQuery $() and other features in your app. 

Step 4: Profit  

The code works because instead of using div.innerHTML() function we are explicitly making a "test" div  which jQuery uses to test for some support. 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
LonghronShen20-Jun-13 22:06
LonghronShen20-Jun-13 22:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.