locked
Using jQuery plugins in Store Apps

    Question

  • Hello!

    I a trying to use jQuery plugin called CProgress, but I'm getting exception on line like ... ctx.drawImage ... 

    Is there any difference between usual page and Windows Store app? Everything works well in IE.


    Thursday, April 24, 2014 7:47 PM

Answers

  • There are a few contextual differences, but Windows Store apps and IE use the same underlying engine. What sort of exception are you getting and on what code? drawImage is supported and works in general.
    Thursday, April 24, 2014 8:13 PM
    Moderator

All replies

  • There are a few contextual differences, but Windows Store apps and IE use the same underlying engine. What sort of exception are you getting and on what code? drawImage is supported and works in general.
    Thursday, April 24, 2014 8:13 PM
    Moderator
  • Hello, Rob!!

    Thank you for answering!

    Error doesn't says much "0x80004005 - JavaScript runtime error: Unspecified error."

    Code is very long, but I try to place a short:

     (function ( $ ) {
     	if (!$.ns) {
     		$.ns = {};
     	};
    
    $.ns.cprogress = function ( el, options) {
    var base = this;
    // Access to jQuery and DOM 
    base.$el = $(el);
    base.el = el;
    base.$el.data( "ns.cprogress" , base );
    
    base.options = $.extend({}, $.ns.cprogress.defaultOptions, options);
    
    
    base.methods = {
    init: function () {
    
    
    //Images
    base.img1 = new Image();
    base.img1.src = base.options.img1;
    
    .......
    .......
    .......
    .......
    
    
    base.ctx.clearRect(0,0,base.width,base.height);
    base.ctx.save();
    base.ctx.drawImage(base.img1,0,0);

    Friday, April 25, 2014 3:40 PM
  • 0x80004005 is just a generic failure, so it doesn't really tell us much.

    The code you posted appears to be fine. Can you reproduce the problem with a cut down version of that or is it only when using the full project?

    --Rob

    Monday, April 28, 2014 11:19 PM
    Moderator
  • Oh, Rob! Seems that I was in panic!)

    The exception was thrown just cause I'v choosed a wrong image folder.

    Everything works well!

     
    Tuesday, April 29, 2014 9:01 AM