Jump to content

IndianaGuy

Members
  • Posts

    91
  • Joined

  • Last visited

Everything posted by IndianaGuy

  1. Ok, so tell me if I am thinking about this right. Page 1- The user can open a window to go to page 2 Page 2 can have a script that will close page 2? What should the value of the new target page be? _blank, _parent _self, _top, _name, or does it matter. Does the actual code to close page 2 has to be coded in page 1.? Thank you so much.
  2. Why would the window.close() not work in Safari mobile on iPhones? I don't have anything complicated. Just a button to run a function on click. The function so far has nothing more than window.close();
  3. Here it is. It did not work on Safari or Chrome (iPhone). RecordAction() was tested with other events and it works. window.onbeforeunload = function() { var Expo = document.getElementById("exposure"); var ct = ConvertTime(Expo.currentTime); var Action = " ClOSED the BROWSER WINDOW ON"; RecordAction(Member,Prospect,FileName,Action,ct); };
  4. There is a tone of articles about this online but most are from 2012 and older. I can't seem to find fresh information. Does anyone know if and how to make the onbeforeunload Event work on mobile devices? Thank you
  5. I figured it out. window.onbeforeunload = function() { //my stuff here };
  6. It's recording the information when the page is left. It doesnot record when the user "x" the tab on the browser window. Any ideas how to make it record at that time as well? Thank you
  7. I am pretty sure I am on the right track, but not there yet. How is this so far? <body onbeforeunload="myLeaving()"> <script> function myLeaving(){ var Expo = document.getElementById("exposure"); // This is a video var ct = ConvertTime(Expo.currentTime); var Action = " He left the domain"; RecordAction(Member,Prospect,FileName,Action,ct); }
  8. So Javascript will have to open a .txt file and document something instead of sending the information to a PHP file?
  9. It was hard deciding where I should put this under the PHP. HTML, OR JAVASCRIPT CODE. Is there a way to trigger a function when the user closes the window? It's a JavaScript function that calls for sending data to a PHP file using Ajax. Thank you
  10. Would I put my css code in mystyle.css or in the mytheme.min.css that ThemeRoller generated for me?
  11. IndianaGuy

    Time Zone

    Perfect. All done and thank you
  12. IndianaGuy

    Time Zone

    How do I change this so it would reflect US central time zone? Thank you $today = date(M j, Y, g:i a");
  13. Thank you for the link. I think there is a little more to it than that. Something about over riding the theme code so it would display my gradient instead. At least that's what the online community is saying so far.
  14. I created a theme using ThemeRoller and it works great. Now I need to add gradient to my buttons which is an option not available while creating the theme. Any advice? Thank you
  15. Can I send a value of a buotton to a JavaScript? or the id or anything at all. II don't care if it gets the value/name/or id. I just need a unique identifier telling the function which button was clicked. Thank you <button type="button" value="Value_test" id="id_test" name=" Name_Test" onclick="mySwitch(this)">Click Me!</button> function mySwitch(x){ xVal = document.getElementById(x).value; console.log("var x = " + xVal); {
  16. Is there a place to go to get free themes to use? Thank you I like Swatch B in this example but that's not what I ma getting when I use date-theme="b" http://jsfiddle.net/Gajotres/VbPRx/
  17. This is what I am using and the console log has nothing in it! unless I am going to the wrong place? function myPlay(){ var Expo = document.getElementById("exposure"); for (var i = 0; i < Expo.played.length; i++) { console.log("Range " + i + " starts at " + Expo.played.start(i) + " and ends at " + Expo.played.end(i)); } }
  18. OOOOH my god! you are so awesome. I am about to get emotional lol. Any particular place I need to put this code? and what will cause it to be called or ran if that's the proper lingo? Thank you so very much
  19. I am very thankful for your advice. Looks like you gave me lots of great tip. However, they all sound Chinese to me. I am way too new to understand what you said :-( All I want is a list of Start time xx:xx TO end time xx:xx for the parts of the media they played. I never in my wildest dreams thought I would spend almost 20 hours now trying to figure it out.
  20. What do you mean "undefined" played" to addEventListener"? It is a part of the HTML video/audio properties. Here is my entire code to be safe. I have been fighting with this for two days and almost 16 hours total (no joke). please help :-) <audio id="exposure" controls preload="auto" onplaying="myplaying()"> <source src="<? echo $Exposure; ?>" type="audio/mpeg" align="middle"> Your browser does not support the audio element. </audio> <br> Total<p id="t"></p> Most recent start time<p id="s"></p> Most recent finish time<p id="e"></p> <script> function myplaying(){ var Expo = document.getElementById("exposure"); var L = Expo.played.length; document.getElementById("t").innerHTML = L; Expo.addEventListener(Expo.played, function() { for (i = 0; i < L; i++) { var S = Expo.played.start; var E = Expo.played.end; document.getElementById("s").innerHTML = S; document.getElementById("e").innerHTML = E; }; }; }; </script>
  21. I couldn't find my original post so I made this one. Sorry. Why is this not working? Thank you function myplaying(){ var Expo = document.getElementById("exposure"); var L = Expo.played.length; document.getElementById("t").innerHTML = L; Expo.addEventListener(played, function() { for (i = 0; i < L; i++) { var S = Expo.played.start; var E = Expo.played.end; document.getElementById("s").innerHTML = S; document.getElementById("e").innerHTML = E; }; }; };
  22. Can someone just tell me a simple yes or no if this can be done? I cant find much info online. Thank you
  23. I have been banging my head all day about this. I am really hoping for some expert guidance. I need to capture and document in a txt file the time ranges played by a user for a media. I needed to end up recording all the ranges played. Feel free to laugh at my code for a bit. I am a super Rookie :-) <? $Name = $_GET["NAME"]; $AccessCode = $_GET["ACCESSCODE"]; $MyTeam = $_GET["MYTEAM"]; $Exposure = $_GET["STORY"]; ?> <audio id="exposure" controls="true" onplayed="myrange()"> <source src="<? echo $Exposure; ?>" type="audio/mpeg" align="middle"> Your browser does not support the audio element. </audio> <script> var FileName = "<?echo $Exposure ;?>"; var LogTo = FileName.replace(/.m4a|.mp3|.wav/,".txt") var Expo = document.getElementById("exposure"); var Prospect = "<? echo $Name ;?>"; var Mem = "<? echo $MyTeam ;?>"; function myrange(){ var Expo = document.getElementById("exposure"); var played = Expo.played; Expo.addEventListener('seeked', function() { for (i = 0; i < Expo.played.length; i++) { var startX = Expo.played.start(i); var endX = Expo.played.end(i) ; var new_startX = convert_time(startX); var new_endX = convert_time(endX); Record_Time(i,new_startX,new_endX); } } // Function to convert the time into a presentable mm:ss format function convert_time(mytime){ var x = Math.round(mytime); var minutes = Math.floor(x / 60); var seconds = x - (minutes * 60); function str_pad_left(string,pad,length) { return (new Array(length+1).join(pad)+string).slice(+length); }; return str_pad_left(minutes,'0',2)+':'+str_pad_left(seconds,'0',2); }; //Function to record time. function RecordTime(L_num,start_time,end_time) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "process.php?length=" + L_num + "&StartTime=" +start_time + "&EndTime=" + end_time, true); xmlhttp.send(); }; </script> </body> </html>
  24. Sounds great. Would you happen to have a link to guide me to the right place. I have been doing a bit of research and it seems like many people decide to post opinions and codes that frankly are just bad ways of solving simple problems. It's the progress bar that I am most concerned with. Thank you Thank you
×
×
  • Create New...