Professional Web Applications Themes

Object required - javascript experts please? - Macromedia Dynamic HTML

Hi, I'm trying to figure out why this script causes a 'Object required' error message inside of IE7 if the user tries to click the scrollbar. isIE=doent.all; isNN=!doent.all&&doent.getElementById; isN4=doent.layers; isHot=false; function ddInit(e){ topDog=isIE ? "BODY" : "HTML"; whichDog=isIE ? doent.all.ccpopup : doent.getElementById("ccpopup"); hotDog=isIE ? event.srcElement : e.target; while (hotDog.id!="titlebar"&&hotDog.tagName!=topDog){ hotDog=isIE ? hotDog.parentElement : hotDog.parentNode; } if (hotDog.id=="titlebar"){ offsetx=isIE ? event.clientX : e.clientX; offsety=isIE ? event.clientY : e.clientY; nowX=pInt(whichDog.style.left); nowY=pInt(whichDog.style.top); ddEnabled=true; doent.onmousemove=dd; } } function dd(e){ if (!ddEnabled) return; whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety; return false; } function ddN4(whatDog){ if (!isN4) return; N4=eval(whatDog); N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP); N4.onmousedown=function(e){ N4.captureEvents(Event.MOUSEMOVE); ...

  1. #1

    Default Object required - javascript experts please?

    Hi, I'm trying to figure out why this script causes a 'Object required' error
    message inside of IE7 if the user tries to click the scrollbar.

    isIE=doent.all;
    isNN=!doent.all&&doent.getElementById;
    isN4=doent.layers;
    isHot=false;

    function ddInit(e){
    topDog=isIE ? "BODY" : "HTML";
    whichDog=isIE ? doent.all.ccpopup : doent.getElementById("ccpopup");
    hotDog=isIE ? event.srcElement : e.target;
    while (hotDog.id!="titlebar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
    }

    if (hotDog.id=="titlebar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=pInt(whichDog.style.left);
    nowY=pInt(whichDog.style.top);
    ddEnabled=true;
    doent.onmousemove=dd;
    }
    }

    function dd(e){
    if (!ddEnabled) return;
    whichDog.style.left=isIE ? nowX+event.clientX-offsetx :
    nowX+e.clientX-offsetx;
    whichDog.style.top=isIE ? nowY+event.clientY-offsety :
    nowY+e.clientY-offsety;
    return false;
    }

    function ddN4(whatDog){
    if (!isN4) return;
    N4=eval(whatDog);
    N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
    N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
    }
    N4.onmousemove=function(e){
    if (isHot){
    N4.moveBy(e.x-N4x,e.y-N4y);
    return false;
    }
    }
    N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
    }
    }

    function ccClose(){
    if(isIE) window.location.hash="";
    if (isIE||isNN) whichDog.style.visibility="hidden";
    if (isIE||isNN) whichDog.style.display="none";
    else if (isN4) doent.ccpopup.visibility="hide";
    }

    function ccPopup(){
    var gotop = doent.getElementById("top");
    if(gotop) gotop.focus();
    if(isIE) window.location.hash="#top";
    if (isIE||isNN) whichDog.style.visibility="visible";
    if (isIE||isNN) whichDog.style.display="";
    else if (isN4) doent.ccpopup.visibility="show";
    }

    doent.onmousedown=ddInit;
    doent.onmouseup=Function("ddEnabled=false");

    mzanime.com Guest

  2. #2

    Default Re: Object required - javascript experts please?

    Let's see the whole page, please.

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "mzanime.com" <com> wrote in message
    news:fodk2h$nit$macromedia.com... 

    Murray Guest

  3. #3

    Default Re: Object required - javascript experts please?

    Naw, I'm not gonna reveal our company secrets :-) But it looks like taking the page out of standards mode solves this little 'problem'.
    mzanime.com Guest

  4. #4

    Default Re: Object required - javascript experts please?

    You'd be just crazy to solve it like that....

    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
    ==================


    "mzanime.com" <com> wrote in message
    news:fofdfl$nnp$macromedia.com... 

    Murray Guest

  5. #5

    Default Re: Object required - javascript experts please?

    mzanime.com wrote:
     

    Browser sniffing is a pointless persuit. And there are more browsers
    than IE, NN and NN4.

    Mick
     

     

     
    Mick Guest

  6. #6

    Default Re: Object required - javascript experts please?

    what about the other browsers then?
    tsiger Guest

  7. #7

    Default Re: Object required - javascript experts please?

    No other browsers do this, only IE.

    Murray wrote: [/ref]

    Murray, what you call crazy, I call GENIUS! :-)

    If it helps at all, here's the HTML part of the code:



    <div id="ccpopup"
    style="position:absolute;left:180px;top:350px;visi bility:hidden;">

    <table border="0" width="429" cellspacing="8" cellpadding="0">
    <tr>
    <td colspan="4" id="titlebar" style="cursor:move">
    <ilayer width="100%" onSelectStart="return false">
    <layer width="100%" onMouseover="isHot=true;if (isN4) ddN4(theLayer)"
    onMouseout="isHot=false">
    &nbsp;&nbsp;For your Protection
    </layer>
    </ilayer>
    </td>
    </tr>
    <tr>
    <td width="1" rowspan="4"><img src="/images/spacer.gif" width="1"
    height="1" alt="" /></td>
    <td colspan="2">To protect our customers from online credit card fraud,
    we
    require the use of a credit card security code.</td>
    <td width="1" rowspan="4"><img src="/images/spacer.gif" width="1"
    height="1" alt="" /></td>
    </tr>
    <tr>
    <td width="133"><img src="/images/icons/cards/visa-sample.gif"
    width="132" height="83"></td>
    <td width="300"><strong>Visa, Mastercard, Discover Card:</strong><br />
    The security code is the 3 digit number found on the back of your card.
    </td>
    </tr>
    <tr>
    <td><img src="/images/icons/cards/ae-sample.gif" width="132"
    height="85"></td>
    <td><strong>American Express:</strong><br />
    The security code is the 4 digit number found on the front of your card.
    </td>
    </tr>
    <tr>
    <td colspan="2" align="right"><input name="image" type="image"
    src="/images/buttons/close-sm.gif" onclick="ccClose();"
    onmouseover="this.src='/images/buttons/close-sm_o.gif';"
    onmouseout="this.src='/images/buttons/close-sm.gif';" /></td>
    </tr>
    </table>

    </div>

    mzanime.com Guest

  8. #8

    Default Re: Object required - javascript experts please?

    >> Browser sniffing is a pointless persuit. And there are more browsers [/ref]

    Thats one of the reasons I stopped posting to this board, someone is always with the negative...
    mzanime.com Guest

Similar Threads

  1. Newbie help on Javascript required
    By taupirho in forum Adobe Acrobat SDK
    Replies: 0
    Last Post: October 6th, 03:38 PM
  2. Any Javascript Experts Here?
    By TXAGGIE in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: April 11th, 09:35 PM
  3. Object required !!!
    By Adam Knight in forum ASP
    Replies: 3
    Last Post: August 19th, 11:39 AM
  4. Object required
    By Rama Raju D.S in forum ASP Components
    Replies: 5
    Last Post: July 29th, 03:46 PM
  5. how to enable the required validators in javascript
    By Elliot Rodriguez in forum ASP.NET General
    Replies: 2
    Last Post: July 16th, 02:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139