Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: way over my head

  1. #1
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default way over my head

    I'm trying to make a script that makes a popup div with a navi and plays a movie that the user picks from the main page list. I'm not sure if this works right

    <script language="javascript" type="text/javascript" >

    /*function to make the new movie <div> and find what HTML <li> was clicked*/

    function misterio(){
    var Mpdiss=document.get.ElementById("misterioProgram")
    var Watching=watchShows.childNode.childNode.a
    function MakeDiv{
    if (Mpdiss.Display="none")
    {Mpdiss.Display="block"}

    if(!e)
    var e=window.event; whichlink=(e.target) ? e.target.id: e.srcElement.id;
    switch (whichlink) {case "watchshows.tt1.ChildNode.a" : misterioProgram.ChooseSeason.Mtt1.display="block";misterioProgram.ChooseSeason.Mtt1.zIndex="100";
    break; }}}


    /*function to display a div with the links and movie*/

    function plugoff(){var tork=document.getElementById("plugs");
    tork.style.display="none"}
    setTimeout("plugoff():"18000);}



    /*function to get the object and tags code for the users plugs in and show a pop up div so they can go to the sites if they need more*/

    function reader(){
    try {document.write (clsid:6BF52A52-394A-11d3B153-00C04F79FAA)};
    catch(e){ try { document.write (clsid:02BF2505-8C17-4B23-BC80-D3488ABDDC6B)};
    catch(e){try{document.write (clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA)};
    catch {confirm("you don't have anything to play AVIs. To get something click okay")
    if(true){document.write("<div id='plugs'> for quick time http://www.apple.com/qtactivex/qtplugin.cab For windosw media http://activex.microsoft.com/activex...ersion=6,0,0,0 or http://www.microsoft.com/windows/win...0/default.aspx for realplayer http://www.real.com/ </div>")};


    /*function to find the right pluginspage for the embed tag*/

    function emplug{ if (clsid=02BF25D5-8C17-4B23-BC80-D3488ABDDC6B ){ 'http://www.apple.com/quicktime/download/'}if else(clsid=6BF52A52-394A-11d3B153-00C04F79FAA){'http://microsoft.com/windows/mediaplayer/ en/download/'} if else (clsid=CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA){'http://www.real.com/products/player/'}}

    /*a function that adds the codebase*/

    function quick() {if(clsid=6BF52A52-394A-11d3B153-00C04F79FAA) ('http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0')
    if else (clsid=02BF25D5-8C17-4B23-BC80-D3488ABDDC6B) {document.write('http://www.apple.com/qtactivex/qtplugin.cab')}


    /*function that writes all the object and embed tags*/
    function playMTV()
    if{ (! document.getElementByID)return;
    var divs=document.getElementByTagName(li);
    for (mist=0;mist<divs.length;mist++)
    { document.write('<object id=" '+' W '+ divs[mist].id + '"standby="this will take some time"<img src="misterioloder" '); document.write('CLASSID="'reader() + ' " width="640" height="504" '); document.write ('codebase=" ' quick() '> <param name="autoStart" value="false" /> <param name="EnableJavaScript" value="true"/> <param name="PlayCount" value="1"/><param name=showControls" value="1"/><param name="HREF" value=" 'divs[mist].id + '.avi "/>'); document.write( '<embed id=" '+divs[mist].id+'"');document.write('pluginspage="' emplug() '" src=" '+divs[mist].id+ .avi '" width="640" height="504" autostart="false" enablejavascript="true"></embed></object>'); MisterioProgram.toplogo.Vrip.onload=playMTV(R);}}



    /*the function that plays the AVIs*/
    function playMTV(R){if (!R) var R=window.event; thisvid=(R.target)?:R.scrElement;
    var movson=document.getElementById("w"+movson.id); try{movson.DoPlay();}catch(R){try {movson.Play();catch(R){alert(" No video player try realplayer,WMP or quicktime");}}}
    PlayMTV();}
    watchShows.childNode.childNode.onclick=Misterio()
    function macclo{ document.write("<div id='closing'><p onclick='closeit()'>close Misterio</p></div>")

    /*a function that stops and closes the movie div*/
    function closeit(){if(Mpdiss.display="block"; try{stop()}catch(R){try{doStop()}catch(R)alert("stop the movie before closing");}

    </script>
    [/COLOR]
    Last edited by riptide; 02-01-2007 at 07:26 PM.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Of course not. It doesn't work at all, it's full of errors.

    I doubt anyone's going to comb through that mess to debug it for you though. Maybe if you tidied it up a bit...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    the indents didn't stay when I pasted it.

    I should have added the html so you can understand it more. I'll fix the it.
    ??? looks like I'll have to fix it with color.

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Yep, there is some serious problems with that script, not closing curly-braces, normal brackets, valid attributes, etc.
    - Mike

  5. #5
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    There are a lot of embeded functions. normal brackets? where is there a problem with that. I thought all my attributes were valid. what's wrong?

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    For example.
    Line Two: var Mpdiss=document.get.ElementById("misterioProgram")

    document.get.ElementById should be document.getElementById

    That, for one is invalid.
    - Mike

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The indentation isn't a problem (although it can be preserved by using [code] tags) so much as the lack of linebreaks. Trying to decipher lines like:
    Code:
    var movson=document.getElementById("w"+movson.id); try{movson.DoPlay();}catch(R){try {movson.Play();catch(R){alert(" No video player try realplayer,WMP or quicktime");}}}
    ... would slow down the task of any human debugger no end.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    ah okay. but as for what the script does, do you see any thing wrong with it. did I learn JS wrong or something.

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes!

    Code:
    if (Mpdiss.Display="none")
    The property is display, not Display; = is an assignment operator, not a comparison operator;
    Code:
    if (clsid=6BF52A52-394A-11d3B153-00C04F79FAA)
    clsid is undefined; the classid itself should be a string, meaning it should be in quotes;
    Code:
    if(true){
    this is useless... I am sure there are more.

    As I said above, there are countless errors. However, your code, by vice of a serious lack of layout (pretty colours are all very nice, but they don't make it any more readable) is virtually indecipherable. I repeat: if you lay your code out nicely, either myself or someone else will most likely be more than happy to go through it and point out or even correct these errors, but as it is, we've better things to do with our time than make your code legible.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    I'll post the code again with it fixed and readable, I'm working out all the html and css that's needed.

    okay I see the mistake but the if true thing was the one thing I wan't sure if it would work. I had a code made by some one else that used = as an comparison operator and it still worked so I didn't really think about it but with a code like this I guess I should be more careful.

    HTML Code:
    function misterio(){
    var Mpdiss=document.getElementById("misterioProgram")
    var Watching=watchShows.childNode.childNode.a
        function MakeDiv{ 
    	    if (Mpdiss.display="none") 
            {Mpdiss.display="block"}
    		
    		     if(!e) 
    			   var e=window.event; whichlink=(e.target) ? e.target.id: e.srcElement.id;
    			      switch (whichlink) {case "watchshows.tt1.ChildNode.a" : misterioProgram.ChooseSeason.Mtt1.display="block";misterioProgram.ChooseSeason.Mtt1.zIndex="100";
    				  break; }}} 
    			
    			/*function to display a div with the links to plus ins*/
    			function plugoff(){var tork=document.getElementById("plugs");
    			tork.style.display="none"}
    			setTimeout("plugoff():"18000);}
    			
    			
    			/*function to make the html object and embed tags and get the right code for the users plug in*/
    			
    			function reader(){ 
    			try {document.write ("clsid:6BF52A52-394A-11d3B153-00C04F79FAA")};
    			catch(e){  try { document.write ("clsid:02BF2505-8C17-4B23-BC80-D3488ABDDC6B")};
    			catch(e){try{document.write ("clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA")};
    			catch {confirm("you don't have anything to play AVIs. To get something click okay")
    			if(true){document.write("<div id='plugs'> for quick time http://www.apple.com/qtactivex/qtplugin.cab For windosw media  http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0 or http://www.microsoft.com/windows/windowsmedia/player/10/default.aspx  for realplayer http://www.real.com/ </div>")}; 
    			
    			/*function to find the right pluginspage for the embed tag*/
    		
    		function emplug{ if (clsid=="02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ){ 'http://www.apple.com/quicktime/download/'}if else(clsid=="6BF52A52-394A-11d3B153-00C04F79FAA"){'http://microsoft.com/windows/mediaplayer/ en/download/'} if else (clsid=="CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"){'http://www.real.com/products/player/'}}
    			
    			
    			/*a function that adds the codebase*/
    			  
    	function quick() {if(clsid=="6BF52A52-394A-11d3B153-00C04F79FAA") ('http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0')
    	if else (clsid=="02BF25D5-8C17-4B23-BC80-D3488ABDDC6B") {document.write('http://www.apple.com/qtactivex/qtplugin.cab')}
    			  
    			/*function that writes all the object and emb tags*/  
    			  function playMTV()
    			  if{ (! document.getElementById)return;
    			  divs=document.getElementByTagName(li);
    			      for (mist=0;mist<divs.length;mist++)
    				  { document.write('<object id=" '+' W '+ divs[mist].id + '"standby="this will take some time"<img src="misterioloder" '); document.write('CLASSID="'reader() + ' "  width="640" height="504" '); document.write ('codebase=" ' quick() '> <param name="autoStart" value="false" /> <param name="EnableJavaScript" value="true"/> <param name="PlayCount" value="1"/><param name=showControls" value="1"/><param name="EnableFullScreenControls" value="0">
    <param name="ShowControls" value="-1">
    <param name="ShowAudioControls" value="-1">
    <param name="ShowStatusBar" value="1">
    <param name="HREF" value=" 'divs[mist].id + '.avi "/>'); document.write( '<embed id=" '+divs[mist].id+'"');document.write('pluginspage="' emplug() '" src=" '+divs[mist].id+ .avi '" width="640" height="504" autostart="false" enablejavascript="true"></embed></object>'); MisterioProgram.toplogo.Vrip.onload=playMTV(R);}}
    				  
    		/*the function tath plays the AVIs*/
    		function playMTV(R){if (!R) var R=window.event; thisvid=(R.target)?:R.scrElement;
    		var movson+document.getElementById("w"+movson.id); try{movson.DoPlay();}catch(R){try {movson.Play();catch(R){alert(" No video player try realplayer,WMP or quicktime");}}}
    		PlayMTV();}
    		watchShows.childNode.childNode.onclick=Misterio()
    		function macclo{ document.write("<div id='closing'><p onclick='closeit()'>close Misterio</p></div>")
    		
    		/*a function that stops and closes the div movie div*/
    		function closeit(){if(Mpdiss.display="block"; try{stop()}catch(R){try{doStop()}catch(R)alert("stop the movie before closing");}
    </script>

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
  •