Page 1 of 1

Something strange... Slideshow error

Posted: Sat Mar 14, 2020 1:48 am
by alex4orly
Please visit this site : https://squadron-125.org.il/
Yes, it is in Hebrew (Right to Left), but you don't need to understand Hebrew to see the problem

The site is sitting inside a master frame
The master frame has at the bottom - within a layout grid a slide show object
When you visit the site, the slide show is designed to start scrolling the pictures - after waiting a bit, but:

1) The slideshow does NOT start
2) Using Chrome, hit F12 - it shows an error

If however you click the 4th or the 6th button (counting from the right) - the slideshow starts moving and continues moving on whatever other page you maybe, including the first home page... Also, hitting the F12 - the error is gone...

I have all the pages inside the master frame, the master frame is the one with the slideshow in it...

Any suggestions?
Thanks

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 7:00 am
by Pablo
You have added the following script, which causes the error::

Code: Select all

<script>
function LogVisitors()
{
   //if (!sessionStorage.previouslyVisited) 
   //{
   //   $(document).ready(function()
   //   {
         $('#insert-file').load('https://www.squadron-125.org.il/visitors.php');
   //   });
   //   sessionStorage.previouslyVisited = true;
   //}
}
</script>
Related info:
https://en.wikipedia.org/wiki/Same-origin_policy

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 7:27 am
by alex4orly
THis is the script that I used in my other post.
It was there all the time, I just inserted it into that function to be called in the OnLoad

It was not executed and hence my visitors were not recorded, that's why I asked my earlier question.
The initial setup was like this, but it was NOT getting into the if() statement, that's why I asked if that was deprecated?

<script>

if (!sessionStorage.previouslyVisited)
{
$(document).ready(function()
{
$('#insert-file').load('https://www.squadron-125.org.il/visitors.php');
});
sessionStorage.previouslyVisited = true;
}

</script>

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 7:33 am
by Pablo
Please read:
https://api.jquery.com/load/
Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol.

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 8:54 am
by alex4orly
Sorry, I am a bit confused - I don't have any Ajax in this function

So?

Thanks again

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 8:57 am
by alex4orly
Also, what if, instead of having the PHP script in an external seprate file,
I insert the script into the calling page and eliminate the JQuery call

Is that not an option?

Cheers

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 12:33 pm
by Pablo
Sorry, I am a bit confused - I don't have any Ajax in this function
Yes, you do. 'Load' uses Ajax.

Note that this is unrelated to WWB.

Re: Something strange... Slideshow error

Posted: Sat Mar 14, 2020 7:25 pm
by alex4orly
OK, thanks again

Re: Something strange... Slideshow error

Posted: Sun Mar 15, 2020 1:42 am
by alex4orly
Well, I resolved it in another way, Please visit : https://squadron-125.org.il/

1) The slideshow starts after a few secends as intended
2) There is no longer any error with F12
3) The visit is recorded in the log file

Here is what I did

1) The index file for the site is now - index.php
2) This file has in it the script for the visit.
3) At the end - it redirect the visitor to frontpage.html - the home page
4) Once the home page loads, the slideshow starts
5) This also ensures that the visitor's visit is recorded only one per visit, other than for those who get out from a page and go back to the website, but those are minirity.

I published it here, just in case somone else has that problem

I am still curious - how did it work for the past 2 years, as it was, without any errors...

Thanks again

Re: Something strange... Slideshow error

Posted: Sun Mar 15, 2020 8:18 am
by Pablo
I am still curious - how did it work for the past 2 years, as it was, without any errors...
The browser may have been updated the way it processes ajax calls.

Re: Something strange... Slideshow error

Posted: Sun Mar 15, 2020 8:52 am
by alex4orly
Probably, that's the only explanation

Thanks again