Click here to Skip to main content
Click here to Skip to main content

Custom jQuery for Windows 8

, 25 Oct 2012
Rate this:
Please Sign up or sign in to vote.
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 

<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. 

<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)

About the Author

niklabh

United States United States
No Biography provided

Comments and Discussions

 
GeneralMy vote of 5 PinmemberLonghronShen20-Jun-13 22:06 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 25 Oct 2012
Article Copyright 2012 by niklabh
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid