Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: XML error message

  1. #11
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Replace:

    Code:
    <style>
    .shakeimage{
    position:relative
    }
    </style>
    <script language='JavaScript1.2'>
    <![CDATA[
    
    /*
    Shake image script (onMouseover)- 
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    //configure shake degree (where larger # equals greater shake)
    var rector=3
    
    ///////DONE EDITTING///////////
    var stopit=0 
    var a=1
    
    function init(which){
    stopit=0
    shake=which
    shake.style.left=0
    shake.style.top=0
    }
    
    function rattleimage(){
    if ((!document.all&&!document.getElementById)||stopit==1)
    return
    if (a==1){
    shake.style.top=parseInt(shake.style.top)+rector
    }
    else if (a==2){
    shake.style.left=parseInt(shake.style.left)+rector
    }
    else if (a==3){
    shake.style.top=parseInt(shake.style.top)-rector
    }
    else{
    shake.style.left=parseInt(shake.style.left)-rector
    }
    if (a<4)
    a++
    else
    a=1
    setTimeout("rattleimage()",50)
    }
    
    function stoprattle(which){
    stopit=1
    which.style.left=0
    which.style.top=0
    }
    ]]>
    </script>
    with (there are many changes, I think I've highlighted them all, just copy the below and replace the above on your page with it):

    Code:
    <style type="text/css">
    .shakeimage{
    position:relative
    }
    </style>
    <script type="text/javascript">
    <!--[CDATA[
    
    /*
    Shake image script (onMouseover)- 
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    //configure shake degree (where larger # equals greater shake)
    var rector=3
    
    ///////DONE EDITTING///////////
    var stopit=0 
    var a=1
    
    function init(which){
    stopit=0
    shake=which
    shake.style.left=0
    shake.style.top=0
    }
    
    function rattleimage(){
    if ((!document.all&&!document.getElementById)||stopit==1)
    return
    if (a==1){
    shake.style.top=parseInt(shake.style.top)+rector+'px';
    }
    else if (a==2){
    shake.style.left=parseInt(shake.style.left)+rector+'px';
    }
    else if (a==3){
    shake.style.top=parseInt(shake.style.top)-rector+'px';
    }
    else{
    shake.style.left=parseInt(shake.style.left)-rector+'px';
    }
    if (a<4)
    a++
    else
    a=1
    setTimeout("rattleimage()",50)
    }
    
    function stoprattle(which){
    stopit=1
    which.style.left=0
    which.style.top=0
    }
    // ]]-->
    </script>
    It will make the J shake when you move your mouse over the J.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. The Following User Says Thank You to jscheuer1 For This Useful Post:

    jendelaniaga (07-24-2008)

  3. #12
    Join Date
    Jul 2008
    Location
    Malaysia
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Another warning sign onmouseover.
    Object expected.

  4. #13
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You killed all the line breaks in the script:

    Code:
    <style type='text/css'>
    .shakeimage{
    position:relative
    }
    </style>
    <script type='text/javascript'>
    <!--[CDATA[ /* Shake image script (onMouseover)- © Dynamic Drive (www.dynamicdrive.com) For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com */ //configure shake degree (where larger # equals greater shake) var rector=3 ///////DONE EDITTING/////////// var stopit=0 var a=1 function init(which){ stopit=0 shake=which shake.style.left=0 shake.style.top=0 } function rattleimage(){ if ((!document.all&&!document.getElementById)||stopit==1) return if (a==1){ shake.style.top=parseInt(shake.style.top)+rector+'px'; } else if (a==2){ shake.style.left=parseInt(shake.style.left)+rector+'px'; } else if (a==3){ shake.style.top=parseInt(shake.style.top)-rector+'px'; } else{ shake.style.left=parseInt(shake.style.left)-rector+'px'; } if (a<4) a++ else a=1 setTimeout("rattleimage()",50) } function stoprattle(which){ stopit=1 which.style.left=0 which.style.top=0 } // ]]-->
    </script>
    Start over with what I actually posted, make sure your editor doesn't strip out the line breaks in the script.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #14
    Join Date
    Jul 2008
    Location
    Malaysia
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Sorry. It was purposely done since the original copy gave the same warning sign. forgot to replace it back with the one you provided.

  6. #15
    Join Date
    Jul 2008
    Location
    Malaysia
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    wait a sec. When i selected the view source, the line breaks dissappeared though I'm really sure to have copy paste exactly the same script you gave. hmm.. I should figure out why.

  7. #16
    Join Date
    Jul 2008
    Location
    Malaysia
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Ok John. probably the error caused by the missing line breaks. I saved the view source data to a new html file, opened it in a new browser and paste your modified script into it and refreshed. Amazingly the letter J shaked!! I dunno why the line breaks dissappeared from the original site or how to repair it.
    Last edited by jendelaniaga; 07-24-2008 at 08:27 PM. Reason: adding "how to repair it" at the end of the sentence.

  8. #17
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Fortunately, a script can be all one line if it is written to be that way. This version of the script (I'm not including the style, keep that as it was) should work regardless of line breaks:

    Code:
    <script type="text/javascript">
    <!--[CDATA[
    
    /*
    Shake image script (onMouseover)- 
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    /* configure shake degree (where larger # equals greater shake) */
    var rector=3;
    
    /* ///////DONE EDITTING/////////// */
    var stopit=0;
    var a=1;
    
    function init(which){
    stopit=0;
    shake=which;
    shake.style.left=0;
    shake.style.top=0;
    };
    
    function rattleimage(){
    if ((!document.all&&!document.getElementById)||stopit==1)
    return;
    if (a==1){
    shake.style.top=parseInt(shake.style.top)+rector+'px';
    };
    else if (a==2){
    shake.style.left=parseInt(shake.style.left)+rector+'px';
    };
    else if (a==3){
    shake.style.top=parseInt(shake.style.top)-rector+'px';
    };
    else{
    shake.style.left=parseInt(shake.style.left)-rector+'px';
    };
    if (a<4)
    a++;
    else
    a=1;
    setTimeout("rattleimage()",50);
    };
    
    function stoprattle(which){
    stopit=1;
    which.style.left=0;
    which.style.top=0;
    };
    // ]]-->
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #18
    Join Date
    Jul 2008
    Location
    Malaysia
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Please, please, please do tell me if I've missed any part of your help

  10. #19
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Calm down. I'm not sure what the problem is with your editor. But I did overreach with my most recent solution. I'm sorry about that. As far as I can tell, you need to find a way to paste in the correct code without losing the line breaks (from post #11 in this thread):

    Code:
    <style type="text/css">
    .shakeimage{
    position:relative
    }
    </style>
    <script type="text/javascript">
    <!--[CDATA[
    
    /*
    Shake image script (onMouseover)- 
    © Dynamic Drive (www.dynamicdrive.com)
    For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    //configure shake degree (where larger # equals greater shake)
    var rector=3
    
    ///////DONE EDITTING///////////
    var stopit=0 
    var a=1
    
    function init(which){
    stopit=0
    shake=which
    shake.style.left=0
    shake.style.top=0
    }
    
    function rattleimage(){
    if ((!document.all&&!document.getElementById)||stopit==1)
    return
    if (a==1){
    shake.style.top=parseInt(shake.style.top)+rector+'px';
    }
    else if (a==2){
    shake.style.left=parseInt(shake.style.left)+rector+'px';
    }
    else if (a==3){
    shake.style.top=parseInt(shake.style.top)-rector+'px';
    }
    else{
    shake.style.left=parseInt(shake.style.left)-rector+'px';
    }
    if (a<4)
    a++
    else
    a=1
    setTimeout("rattleimage()",50)
    }
    
    function stoprattle(which){
    stopit=1
    which.style.left=0
    which.style.top=0
    }
    // ]]-->
    </script>
    You might be able to make it an external file. But before we mess around with that, what editor are you using?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  11. #20
    Join Date
    Jul 2008
    Location
    Malaysia
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I'm using blogger.com. not sure whether this answer your question.

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
  •