Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts

    Capture which video id is playing from video array

    Hi, this code below works fine on a per single video page (1 video on its own page) and i am very happy with that.

    However, now i am trying to apply this code using an array of videos (8 per page), and i need to capture which video id is playing when the user presses the play button. I am using this for view counter.


    so in the media.addEventListener now do i know which video from the array they clicked play. Should i change the default name of example_video_1 (which is the videojs player), to maybe vid id so that each player on the page has a dif id. Cant get my head around this at at the moment.

    Thanks

    html
    Code:
      <!-- smarty foreach starts -->
    
           <!-- set value div for current video id -->
            <div id="thevideoid" style="display:none;">{$item.vid}</div>
    
      <!-- player and all other video data displays properly on page from array -->
      <!-- smarty foreach ends -->
    here is the player code inside the same html file

    Code:
     <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="none"    height="{$item.height}"  width="{$item.width}"   
    poster="{$item.vbigthumb}" data-setup="{}">
                  <source src="{$item.urlvid}" type="{$item.vtype}">   
                  <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
                  </video>
    js code

    Code:
    {literal}
    
    <script type="text/javascript">
          
    /* yes the literals are backwords thats how it works */
    /* for smarty in js - see smarty forum */
    /* addEventListener is ok we do not support < ie9 */
    /* do not use function(event) it does not work on ie */
    /* url's have random number to stop caching */
          
     /* init vars */     
     var r = '?ran='+Math.floor((Math.random() * 10000) +1); 
    
     //this worked fine here for single page but not for array
     //so moved it down to the event code below    
     //var vid = {/literal} '{$vid}'{literal};
    
    //init var
    var vid = '';
    
    //this is for random url
     var ajaxurlvideoviews = {/literal} '{$ajaxurlvideoviews}'{literal};
     var updatevideoviewsurlrand = ajaxurlvideoviews+r;   
          
          
           //this is the videojs player 
            var media = document.getElementById('example_video_1');
    
            // Playing event
            media.addEventListener("playing", function() {
    
           //moved this here and every div does have its own value in the
           //html (source page) but the divs all have the same name
           //so still dont know which video the user clicked play button
    
            var vid = document.getElementById('thevideoid'); 
    
      
            //this works fine just need valid vid
            ajaxUpdateVideoViews(vid, updatevideoviewsurlrand); 
            
               // $("#output").html("Playing event triggered");
            });
            
            
            //these listeners are not used for now
        
            /* 
            // Pause event
            media.addEventListener("pause", function() { 
                $("#output").html("Pause event triggered"); 
            });
    
            // Seeking event
            media.addEventListener("seeking", function() { 
                $("#output").html("Seeking event triggered"); 
            });
    
            // Volume changed event
            media.addEventListener("volumechange", function(e) { 
                $("#output").html("Volumechange event triggered"); 
            }); 
            */
    
    </script> 
    
    {/literal}

    UPDATE: so i listed out the media object and it appears that the event finds the first occurance of "example_video_1" even though there are 8 videos on the page, im pretty sure this is normal and should be this way. But noodling over this logic tells me that i need to get my information from the button element data and not the media object. When the button is clicked i should be able to get the video id from that event i hope. Ill dig into this idea

    I also wonder if i can use a onclick option in the video tag, that would allow me to pass the data from there.
    Last edited by durangod; May 17th, 2019 at 10:06 AM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  2. #2
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    Whooo hooo got it.... this was the answer to my situation, i just had to sit and think about not making it too complicated.

    using onclick on the video tag works
    Code:
    <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="none"    height="{$item.height}"  width="{$item.width}"   
    poster="{$item.vbigthumb}" data-setup="{}" onclick="getVidId({$item.vid});">
    which allows me to grab the individual video id when they click play...
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  3. #3
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    Well i am not quite done yet, now i need to weed out the play from the pause so that if they pause and then hit play again, it does not send data, it should only send data via ajaxUpdateVideoViews one time per video per user per page load.

    So i have come up with this but its not working... yet

    this is the fuction that is called when they click the video play button.

    I think my queryselector line is all screwed up. Is 'video' the html5 video tag?
    If not i guess i need to define it.


    Code:
     /* init vars */ 
     var vid = parseInt(videoid);
     var r = '?ran='+Math.floor((Math.random() * 10000) +1);  
     var ajaxurlvideoviews = {/literal} '{$ajaxurlvideoviews}'{literal};
     var updatevideoviewsurlrand = ajaxurlvideoviews+r;
     
    
     
     Object.defineProperty(HTMLMediaElement.prototype, 'playing', {
        get: function(){
            return !!(!this.paused && !this.ended && this.play);
            
             // Playing event
        
             if(document.querySelector('video').playing)
             {
               ajaxUpdateVideoViews(vid, updatevideoviewsurlrand);
             }
        }
    })
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  4. #4
    Senior Coder deathshadow's Avatar
    Join Date
    Feb 2016
    Location
    Keene, NH
    Posts
    3,427
    Thanks
    4
    Thanked 488 Times in 476 Posts
    Id's are supposed to be UNIQUE, to that end each of your videos should have a DIFFERENT ID. This is why I wouldn't use an ID, I'd use a class. Let's say your class was "hookVideo".

    Code:
    	var hookVideos = document.getElementsByClassName('hookVideo');
    	for (var video of hookVideos) {
    		video..addEventListener("playing", function(e) {
    			ajaxUpdateVideoViews(e.target, updatevideoviewsurlrand); 
    		});
    	}
    Or use a common parent wrapper as the base, and getElementsByTagName('video').

    The big trick is to use Event.target -- aka the element that caused the event -- to trap which video sent the message.

    In that way, you've got way too many pointless classes and ID's slopped in there for nothing. Let's say your eight videos all go into one DIV.

    Code:
    <div id="videos">
    	<!-- assume this repeats 8 times -->
    	<video controls preload="none" poster="{$item.vbigthumb}">
    		<source src="{$item.urlvid}" type="{$item.vtype}">  
    		<p>
    			To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/">supports HTML5 video</a>
    		</p>
    	</video>
    	<!-- end repeat -->
    <!-- #videos --></div>
    There is NO reason to use any more classes or ID's than that. Then the same JS would just have one line changed:

    Code:
    var hookVideos = document.getElementById('videos').getElementsByTagName('video');
    And boom, it will auto-trap ALL videos inside that outer DIV.

    If you've been suckered into some sort of dumbass framework that insists every blasted element needs a class on it, kick that derpitude to the curb. Though honestly, I say the same about the mental enfeeblement that is "smarty". PHP already is a templating system, so why run a template system on top of a template system? If "function" and "echo" with comma delimits is "too hard" you probably shouldn't be working in PHP.

    I really don't understand why people are so enamored with these systems that make things ten times more complex than need be, whilst claiming it's somehow "easier". Bootcrap, vue, react, smarty, train wreck laundry lists of how not to build websites, and making even the simplest of tasks as complex and convoluted as possible.
    Last edited by deathshadow; May 17th, 2019 at 05:40 PM.
    “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
    http://www.cutcodedown.com

  5. Users who have thanked deathshadow for this post:

    durangod (May 17th, 2019)

  6. #5
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    Thanks DS, i tried to stay away from getElementById because it would only grab the first one it saw, so i was trying different ways to stay away from that. I appreciate the education on this and the reason why, thanks for the kind reply and the explanation with it.

    As to the other, i dont prefer smarty or any of the other "helpers" but i have some old plugins that were done in that format and they need attention once in a while so yes sadly to be fair to users i need to get my hands dirty in the muddy creek of "helpers".

    Again much thanks for the explanation, it helps so much to know why.
    Last edited by durangod; May 17th, 2019 at 08:01 PM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  7. #6
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    DS i assume this is a typo and should just have one dot "video."

    Code:
    video..addEventListener("playing", function(e)
    I also did fix the id (just to make it as unique as it should be) to id="video_{$item.vid}" so the video record id makes it unique.

    Sadly i been away from this so long, the other day i went to do a php file and forgot the php command to start the page lol

    So i thought maybe even though im retired i better at least do something so i dont forget how to do everything, js and the other stuff i was never that good at but my php i was proud of. I was always so proud of myself over the years that i could code php in my sleep most times and do it securely and professionally.

    Often times in those days i would jump up in the middle of the night with the answer in my head and run over to the computer and get the code saved on even a notepad file asap. Now that i am home most of the time either working outside piddling jobs in the yard or watching the news my dreams are no more of coding but of the violence in the world.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  8. #7
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    how do i look at HTMLVideoElement to see what im working with visually.


    Code:
     var str = JSON.stringify(e.target);
    		    
    console.log("target is "+str);
    this returns

    target is {"playerId":"video_1","player":null,"initNetworkState_":1,"vdata1558126186036":1855}

    not sure what all those are i know video_1 is the video id of video+record number but not sure what the other stuff is

    even with using e.target it still only grabs the first occurance, the other videos in the array do not console.log


    html

    the video tag already has a class name. Maybe i should try to add a class name to the div as well, but have not done so yet.

    Code:
              <div id="videos">
                  <video id="video_{$item.vid}" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="none"    height="{$item.height}"  width="{$item.width}"   
    poster="{$item.vbigthumb}" data-setup="{}" onclick="getVidId({$item.vid});">
                  <source src="{$item.urlvid}" type="{$item.vtype}">   
                  <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
                  </video>
               </div>
    yeah this is only pulling the first one it finds thats all..

    Code:
    var hookvideos = document.getElementById('videos').getElementsByTagName('video');
    so the for only has one to deal with, it should have 8 loaded


    looks like i need to build an array in js or jquery
    Last edited by durangod; May 17th, 2019 at 11:00 PM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  9. #8
    Senior Coder deathshadow's Avatar
    Join Date
    Feb 2016
    Location
    Keene, NH
    Posts
    3,427
    Thanks
    4
    Thanked 488 Times in 476 Posts
    e.target would literally be the object of the video tag that triggered the event. The video tag you paused.

    For example:
    Code:
    <button id="test">Test</button>
    Code:
    var button = document.getElementById('test');
    button.addEventListener('click', function(e) {
      console.log('e.target.textContent = ', e.textContent); // "Test"
      console.log('e.target.tagName = ', e.tagName); // "button"
      console.log('e.target == button ? ', e.target == button); // Boolean True
    });
    Using e.target is VERY handy for making generic routines without loads of extra "storage" variables or endlessly doing "getElementBy". When you click on the button, Event.target is set to the tag element that initiated the event.

    If coding legacy support for IE8/earlier, you would polyfill to window.srcElement after of course polyfilling the passed Event parameter to window.event... something I'm REALLY glad we can really just say "oh well" to now and not even bother with.

    Basically if you REALLY want that legacy IE support, you would change that to:

    Code:
    function(e) {
      if (!e) e = window.event;
      if (!e.target) e.target = window.srcElement;
      // etc, etc, etc.
    But since legacy IE doesn't support <video>, no real point in bothering with that.

    In any case, e.target is the actual video tag just as if you did a getElementById. Anything you would do with the result of getElementById you can do with e.target... for example e.target.firstElementChild would be the source tag inside the <video>, and e.target.lastElementChild would be the paragraph.

    ... and stringify doesn't fully parse system objects. That's why for debugging I used console.log without stringify. Just comma delimit:

    console.log('target is ', e.target);

    And any decent browser should give you a navigable object output. Seems like a lot of people don't know that console.log's output can be comma delimited, or that you can output objects that way, or that string addition and parsing in this case has three to four times the processing overhead and at least double the memory footprint. In cases you can avoid string addition, do so! Another reason to avoid screwing around with innerHTML. Use textContent or go to the DOM when writing content.
    “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
    http://www.cutcodedown.com

  10. Users who have thanked deathshadow for this post:

    durangod (May 20th, 2019)

  11. #9
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    I have to go mow my grass on my other lot before this 3 days of rain hits us all starting tomorrow. I thought thats what you said is that the data was the one i clicked on so i didnt expect all of them in that data, but the data was the same with the same video id no matter which one i chose to play, so thats why i was thinking of an array.

    Thanks for the reply DS ill check this out tonight after i get back from the other property, i have not read it all yet just the first part, but but i will when i get home.... thanks
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  12. #10
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    ok yes sir i do understand that e.target is powerful i did some testing and its all good stuff ty for that..

    For some reason i just dont trust getElementById for use in this case, i wanted to try to stick with something that i feel better at using.

    I have used the getElement????? before but for this case i just wanted to use something else so in that case there are two ways i found to get just the data i want to listen to and nothing more, both are jquery.


    Both of these will produce an object of just the videos with the id name starting with video_ which is what i wanted here.

    First way and one line of code..

    Code:
    var videohooks = $('*[id^="video_"]');

    Same result but just a different way to load it, longer code
    Plus for some reason i was having to fight iteration protocal in looking at the object on this one.
    From what i understand some objects elements are not designed to be browsed (displayed), that is how i understand it so far.
    or it could be because its an empty obj to start with im not sure.

    Code:
     var videohooks = [];
    //get only id's starting containing video_ 
    $('div[id^="video_"]').each(function(){ 
        var data = $(this).attr('id');
        videohooks.push(data);
    });
    so now since we have this in the object

    video_1,video_2,video_3,video_9,video_10
    We will only be listening for playing event on those items and nothing else.


    So we loop through listening.

    Code:
    for (var i = 0 ; i < videohooks.length; i++) 
    {
    
       videohooks[i].addEventListener('playing' , function(e) { 
       console.log(e.target);
    		
        //update view data - this is disabled until working correctly
        //ajaxUpdateVideoViews(e.target, updatevideoviewsurlrand);
    	    
        });
    		
    }//close for loop
    And now when i click any video on the page i get the correct e.target data.

    click the first video i get
    <video id="video_1_html5_api" class="vjs-tech" preload="none" poster="https://www.oxamerica.com/oxdemo/ultimatevideofiles/5cd5238e246ae4vf1/5cd5238e226ca1557472142big.png" data-setup="{}" onclick="getVidId(1);" tabindex="-1">
    <source src="https://www.oxamerica.com/oxdemo/ultimatevideofiles/5cd5238e246ae4vf1/5cd5238e226ca1557472142test.mp4" type="video/mp4">
    <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank" class="vjs-hidden" hidden="hidden">supports HTML5 video</a></p>
    </video>
    click the second video i get

    <video id="video_2_html5_api" class="vjs-tech" preload="none" poster="https://www.oxamerica.com/oxdemo/ultimatevideofiles/5cd5238e246ae4vf1/5cd52595ef4b61557472661big.png" data-setup="{}" onclick="getVidId(2);" tabindex="-1">
    <source src="https://www.oxamerica.com/oxdemo/ultimatevideofiles/5cd5238e246ae4vf1/5cd52595ef4b61557472661big_buck_bunny.webm" type="video/webm">
    <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank" class="vjs-hidden" hidden="hidden">supports HTML5 video</a></p>
    </video>
    But there is one bug i am working on here.

    When i click the first video i get one result in e.target
    When i click the 2nd video i get 2 same results in e.target
    When i click the 3rd video i get 3 same results in e.target
    and so on....

    The reason i went with the for using i=0 on the length is because when i obj.addEventListener it would tell me that it was not a function and honestly i got tired of
    dealing with it. So for example videohooks.addEventListener would tell me that it was not a function

    So this is where i am at now, i just need to fix my loop bug.

    First things that comes to mind is maybe on.playing brake sort of thing.

    UPDATE: looks like removeEventListener() might be the thing to use.

    Another Update: so turns out it was not really a loop issue at all, i was sending e.target to console and the listener was doing what it was suppose to do, when i changed it to e.target.id i only got one response per click so it looks like it was not a issue at all, just displaying the wrong data.

    Now that i have the id

    video_2_html5_api
    i can explode that using the _ and get my video id number, then send that off to update the video views and done.

    ")
    Last edited by durangod; May 18th, 2019 at 09:55 AM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  13. #11
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    Question: since i have the video id as part of the call to the function onclick, should i trust that or should i go ahead and get the id directly using the e.target data as a base before exploding? I dont think i understand the console so much because when i click one video i get the id and then i click pause, and then i click the other video and i get id, id (one of the id's is subdued. So i dont know if that means that i am getting both or it if that is a history display in console.

    Here is the screenshot.

    -etargettest.jpg
    Last edited by durangod; May 18th, 2019 at 10:07 AM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  14. #12
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    Got it, here is the whole function, i decided to go ahead and use both the onclick data and the e.target.id and compare them, if match then update, if not do nothing. Alittle overkill maybe but i feel better doing it that way. I should probably rename the function as well to be more inline with what its purpose is, and that is to gather data to update the views counter.

    Code:
    {literal}
    
    <script type="text/javascript">
    
    "use strict";
    
    function getVidId(videoid) {
        
    /* yes the literals are backwords thats how it works */
    /* for smarty in js - see smarty forum */
    /* addEventListener is ok we do not support < ie9 */
    /* function(event) does not work on ie but thats ok*/
    /* url's have random number to stop caching */
         
     /* init vars */ 
     var vid = videoid;
     var r = '?ran='+Math.floor((Math.random() * 10000) +1);  
     var ajaxurlvideoviews = {/literal} '{$ajaxurlvideoviews}'{literal};
     var updatevideoviewsurlrand = ajaxurlvideoviews+r;
     var videohooks = $('*[id^="video_"]');
    
     for (var i = 0 ; i < videohooks.length; i++) 
     {
    
       videohooks[i].addEventListener('playing' , function(e) { 
      
        //for testing only
        //console.log(e.target.id); 
        
        //cut it up and get the id
        var tid = e.target.id;
        var parts = tid.split("_");
        var targid = parts[1];
        
        //compare the e.target result to the onclick result
        //id's should match before views is updated
        
        if(vid == targid)
        {
            
          //update view data    
          ajaxUpdateVideoViews(targid, updatevideoviewsurlrand);
        
         }//close if
        
      }); //close listener function
    		
     }//close for loop
       
    }//close function
    
    </script> 
    
    {/literal}
    Last edited by durangod; May 18th, 2019 at 10:29 AM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  15. #13
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    Is there any reason that any of this would not work on mobile? Desktop works great, mobile version not working and i dont think there is a way of using the console on android mobile.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave

  16. #14
    Senior Coder durangod's Avatar
    Join Date
    Nov 2010
    Location
    East Texas USA
    Posts
    2,087
    Thanks
    353
    Thanked 57 Times in 55 Posts
    I was curious if anyone out there might have android studio installed and set up to view websites, i need someone to look at a site feature and tell me if there are any js errors on mobile. I did download android studio and watched some videos on it but it seems to me its quite a task to set it up initially to view website and js console, and i am not a mobile developer. I am completely done with everything else and everything works on desktop but something is wrong on mobile and i just want to check the console for mobile.

    I find it hard to believe that in this day and age its still so darn difficult to set up such a needed tool as console for mobile. I dont want to use usb remote dev because full access is required and IMO this is how people get their personal cell phone data stolen so i dont want to use remote dev usb setup.

    If interested i can give you the info.

    UPDATE: ok it may not be an error it may just be the wrong event for mobile. Seems like mobile may use ontouchstart instead of onclick... testing now

    Yep that was the reason my js on mobile was not executing at all because i used onclick and it should have been ontouchstart

    Code:
    onclick="getVidId(...whatever...);
    
    changed to 
    
    ontouchstart="getVidId(...whatever...);
    
    
    now my js works :) well the alert works lol we will see about the other, im sure something will break with my luck lol...
    I am glad to be retired i have no interest in coding for the new mobile world... Took me 3 days to do all the php which was a ton, and all the other stuff which was alot, and has taken me a full week just on the js and mobile BS....

    Anyway i really thank DS for his help and assistance, with his inspiration and support i was able to get a view of the data i was working with and that is 90 percent of the deal. His replies made me ask questions that i had not considered and lead me down the right path afterall, in my own way but again i am thankful for his sharing of advice and knowledge.

    Last edited by durangod; May 20th, 2019 at 06:31 AM.
    If a php file only has php code within it you do not need to use the closing php tag
    A good way to remember objects from arrays is you shoot objects with arrows Example: $name->id; then Arrays are $name['id'];
    durangod is short for durango dave


 

Tags for this Thread

Posting Permissions

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