473,326 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

JScript Runtime Error

29
Hi,

I have added qscroller.js file in my application. I have added the reference in the master page.
Though the reference path is correct, the system throws Microsoft runtime JScript error: 'class' is undefined in IE

May I know what is the problem here. Expecting a solution asap.

Thanks
Mar 1 '11 #1
3 1792
acoder
16,027 Expert Mod 8TB
A solution would be difficult without seeing the code. Also, have you tested in other browsers?
Mar 2 '11 #2
beulajo
29
yes this works fine in firefox but it does not work in IE.
Code is given below, error occurs in the firs line of th e code,

Expand|Select|Wrap|Line Numbers
  1. var QScroller = new Class({
  2.     options: {
  3.         slides: 'qslide',
  4.         direction: 'h',
  5.         duration: 3000,
  6.         auto: false,
  7.         delay: 1000,
  8.         transition: Fx.Transitions.linear
  9.     },
  10.     initialize: function(wrapper, options) {
  11.         this.setOptions(options);
  12.         this.wrapper = $(wrapper);
  13.         this.wrapper.setStyles({
  14.             position: 'relative',
  15.             overflow: 'hidden'
  16.         });
  17.         this.wrapper.addEvent('mouseenter', this.fireEvent.pass('onMouseEnter', this));
  18.         this.wrapper.addEvent('mouseleave', this.fireEvent.pass('onMouseLeave', this));
  19.  
  20.         this.slideOut = new Element('div').setStyles({
  21.             position: 'absolute',
  22.             overflow: 'hidden',
  23.             top: 0,
  24.             left: 0,
  25.             width: this.wrapper.getStyle('width'),
  26.             height: this.wrapper.getStyle('height')
  27.         }).injectInside(this.wrapper);
  28.  
  29.         this.slideIn = this.slideOut.clone();
  30.         this.slideIn.injectInside(this.wrapper);
  31.  
  32.         this.slides = $$('.' + this.options.slides);
  33.  
  34.         if ($defined(this.options.buttons)) {
  35.             if ($defined(this.options.buttons.next)) {
  36.                 $(this.options.buttons.next).addEvent('click', this.next.bind(this));
  37.             }
  38.             if ($defined(this.options.buttons.prev)) {
  39.                 $(this.options.buttons.prev).addEvent('click', this.prev.bind(this));
  40.             }
  41.             if ($defined(this.options.buttons.play)) {
  42.                 $(this.options.buttons.play).addEvent('click', this.play.bind(this));
  43.             }
  44.             if ($defined(this.options.buttons.stop)) {
  45.                 $(this.options.buttons.stop).addEvent('click', this.stop.bind(this));
  46.             }
  47.         }
  48.         this.auto = this.options.auto;
  49.         this.idxSlide = 0;
  50.         this.step = 0;
  51.         this.isFirst = true;
  52.     },
  53.     load: function() {
  54.         if (!this.isFirst) {
  55.             this.idxSlide += this.step;
  56.             if (this.idxSlide > this.slides.length - 1) {
  57.                 this.idxSlide = 0;
  58.             } else if (this.idxSlide < 0) {
  59.                 this.idxSlide = this.slides.length - 1;
  60.             }
  61.         }
  62.         this.curSlide = this.slides[this.idxSlide].clone();
  63.         this.show();
  64.     },
  65.     show: function() {
  66.         var slide = this.slideIn.getElement('div');
  67.         if (slide) {
  68.             slide.replaceWith(this.curSlide);
  69.         } else {
  70.             this.curSlide.injectInside(this.slideIn);
  71.         }
  72.         this.doEffect();
  73.     },
  74.     doEffect: function() {
  75.         this.fxOn = true;
  76.         var d = this.isFirst ? 0 : this.options.duration;
  77.         var t = this.options.transition;
  78.  
  79.         var fxObj = this.slideIn.effects({
  80.             duration: d,
  81.             transition: t
  82.         });
  83.         var inX = 0;
  84.         var inY = 0;
  85.         var outX = 0;
  86.         var outY = 0;
  87.         var ww = this.wrapper.getStyle('width').toInt();
  88.         var wh = this.wrapper.getStyle('height').toInt();
  89.         if (this.step > 0) {
  90.             if (this.options.direction == 'h') {
  91.                 inX = -ww;
  92.                 outX = ww;
  93.             } else {
  94.                 inY = -wh;
  95.                 outY = wh;
  96.             }
  97.         } else {
  98.             if (this.options.direction == 'h') {
  99.                 inX = ww;
  100.                 outX = -ww;
  101.             } else {
  102.                 inY = wh;
  103.                 outY = -wh;
  104.             }
  105.         }
  106.         if (this.isFirst) {
  107.             if (this.auto) {
  108.                 this.step = 1;
  109.             }
  110.             this.isFirst = false;
  111.         }
  112.         fxObj.start({
  113.             top: [inY, 0],
  114.             left: [inX, 0],
  115.             opacity: [1, 1]
  116.         });
  117.         this.slideOut.effects({
  118.             duration: d,
  119.             transition: t
  120.         }).start({
  121.             top: [0, outY],
  122.             left: [0, outX]
  123.         });
  124.  
  125.         this.fxEnd.delay(d + 75, this);
  126.     },
  127.     fxEnd: function() {
  128.         this.fxOn = false;
  129.         this.swapSlides();
  130.         if (this.auto) {
  131.             $clear(this.timer);
  132.             this.timer = this.load.delay(this.options.delay, this);
  133.         }
  134.     },
  135.     stop: function() {
  136.         $clear(this.timer);
  137.         this.auto = false;
  138.     },
  139.     play: function() {
  140.         if (!this.auto) {
  141.             $clear(this.timer);
  142.             this.auto = true;
  143.             this.step = 1;
  144.             if (!this.fxOn) {
  145.                 this.load();
  146.             }
  147.         }
  148.     },
  149.     next: function() {
  150.         this.stop();
  151.         if (this.fxOn) { return; }
  152.         this.step = 1;
  153.         this.load();
  154.     },
  155.     prev: function() {
  156.         this.stop();
  157.         if (this.fxOn) { return; }
  158.         this.step = -1;
  159.         this.load()
  160.     },
  161.     swapSlides: function() {
  162.         this.slideOut.setStyles({
  163.             zIndex: 0,
  164.             opacity: 0
  165.         });
  166.         var t = this.slideOut;
  167.         this.slideOut = this.slideIn;
  168.         this.slideIn = t;
  169.     }
  170. });
  171. QScroller.implement(new Options, new Events);
what went wrong : it shows as Class undefined
Mar 2 '11 #3
Hi everyone,
I think it's a little late to respond, but it will to others.

To solve the problem on IE 9 I changed Mootools version 1.3.2 (cétait version at the time) and I changed these two lines:


this.wrapper.addEvent ('mouseenter' this.fireEvent.pass ('OnMouseEnter', this));
this.wrapper.addEvent ('mouseleave' this.fireEvent.pass ('OnMouseLeave', this));

by:


this.wrapper.addEvent ('mouseenter' this.stop.bind (this));
this.wrapper.addEvent ('mouseleave' this.play.bind (this));

And now it works on IE 9

Thierry
Sep 21 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Dan Roberts | last post by:
I am running some off-the-shelf software that is written in ASP, which uses JScript to generate dynamic content within HTML forms. There are several ASP pages which are partially rendering to IE,...
0
by: mag48 | last post by:
Inside the footer of a datagrid (used to insert into DB) I have a textbox and just beside it I have a required Field Validator. I use the footer of the grid to add a record to the DataBase. When...
1
by: finditajr | last post by:
Hello I'm having the following problem: My main webpage calls a function stored in a .js file that creates an HTML window to display a calendar. Whenever I click on a date in that calendar,...
1
by: fhedzi | last post by:
please guys help me out i don't understands and what to do.
10
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred."...
11
by: baburk | last post by:
I wants to capture Table contents(ie. entire table) into image file in aspx page. How to do?. There is a code for captuer a portion of he screen. Cature a rectangle of the screen and save to...
1
by: pratimapaudel | last post by:
function Showdiv() { var SelectStates = document.getElementById('Select1').value; if(SelectStates ="3") { document.getElementById("div2").style.display = "block"; } else ...
7
by: EdEvans | last post by:
have the following code on a page: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Page.ClientScript.RegisterStartupScript(this.GetType(), "DoPreview",...
3
by: suganya | last post by:
Hi Some professionals already has developed the project using menu. In my company, they have given me task to clear the error in that. It is a script file named as "menubarAPI4.js" which is kept...
0
by: =?Utf-8?B?VEQgaW4gUFNQ?= | last post by:
I've created a web service which I'm just running on my localhost development machine right now. If I open http://localhost/WebServices/MyWebService.asmx in IE everything works fine. However when...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.