Jump to content


Text-Button not working with In-Page-Popup on HTTPS

https

3 replies to this topic

#1 sebastian.julius

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 26 January 2012 - 12:10 PM

Hi,

I integrated a livezilla text button into this site:

http://www.monamikids.de

You can see it by clicking on the orange button on the right side of the website. This opens a help center layer. As long as the protocol is HTTP, the browser simply displays the layer and everything works fine. If you switch to HTTPS and try to open the help center again, you'll see that the "online"-text from livezilla is written over the whole page and everything else disappears.

Do you have any idea why this happens?

Thanks in advance


Here are the screenshots:

click here
Attached Image: Bildschirmfoto 2012-01-26 um 13.07.22.png

this should be opened
Attached Image: Bildschirmfoto 2012-01-26 um 13.07.28.png

this appears via HTTPS
Attached Image: Bildschirmfoto 2012-01-26 um 13.07.40.png

#2 Patrick Keil

    Administrator

  • Administrators
  • 602 posts
  • LocationSingen, Germany

Posted 26 January 2012 - 02:49 PM

Quote

Do you have any idea why this happens?
No, actually not. For LiveZilla, it makes no difference whether HTTPS is activated or not. In both cases, the same content is being sent to the visitor.

I could imagine that one of your website javascripts is making a difference and it just seems that LiveZilla would be the problem. Did you try to trackdown this issue on a simpler website, outside of the javascript heavy pop up?

#3 sebastian.julius

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 January 2012 - 10:03 AM

Hi Patrick,

I finally found the troublemaker. It was the jQuery wrapInner and append method that is called by the prettyPhoto (popup) library. Both methods let the browser re-execute the inline JavaScripts which appended the LiveZilla text to the body tag instead of to where it is defined.
Thus, "document.write(html)" from you image.php simply placed the "html" to the body.

My solution was to adjust your image.php file (around line 72):

before
if(!empty($html))
  exit("document.write(\"".$html."\");");

now
if(!empty($html))
  exit("$('#livezilla_textbox').append(\"".$html."\");");

the JavaScript on the target page is now outside of the popup-layer:

before, in-line where it should be displayed
<script type="text/javascript" src="/image.php?...</noscript>

now, in-line, plain html spacer
<span id="livezilla_textbox"></span>

// at end of the footer
<script type="text/javascript" src="/image.php?...</noscript>


of course, I'm using jQuery. But the solution would also be praticable with plain JavaScript and maybe more safe for advanced placements of the buttons.

Besides, i found out that for XHTML the document.write approach is deprecated. see here http://www.w3.org/Ma...ml-faq#docwrite


Greetings,

Sebastian

#4 Patrick Keil

    Administrator

  • Administrators
  • 602 posts
  • LocationSingen, Germany

Posted 27 January 2012 - 12:13 PM

Thanks for this valuable information. We will check this ASAP.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users