I’ve been looking into this problem and have found that when the problem occurs, there is a chunk of code missing from the page (the select element). Your code looks for :
var classic = jQuery('.goog-te-combo');
and fails to find it because that section has been replaced by .
Do you have any idea what would be causing this to happen under certain circumstances?
The good & bad code is (no formatting – please expand to make it readable for yourself):
GOOD:
<section id="glt_widget-2" class="widget widget_glt_widget"><div class="widget-wrap"><div id="flags" class="size18"><ul id="sortable" class="ui-sortable" style="float:left"><li id="Dutch"><a href="#" title="Dutch" class="nturl notranslate nl flag Dutch" data-lang="Dutch"></a></li><li id="English"><a href="#" title="English" class="nturl notranslate en flag English" data-lang="English"></a></li><li id="French"><a href="#" title="French" class="nturl notranslate fr flag French" data-lang="French"></a></li><li id="German"><a href="#" title="German" class="nturl notranslate de flag German" data-lang="German"></a></li><li id="Italian"><a href="#" title="Italian" class="nturl notranslate it flag Italian" data-lang="Italian"></a></li><li id="Spanish"><a href="#" title="Spanish" class="nturl notranslate es flag Spanish" data-lang="Spanish"></a></li></ul></div><div id="google_language_translator" class="default-language-en"><div class="skiptranslate goog-te-gadget" dir="ltr" style=""><div id=":0.targetLanguage"><select class="goog-te-combo" aria-label="Widget "Sprache übersetzen""><option value="de">Deutsch</option><option value="en">Englisch</option><option value="fr">Franz?sisch</option><option value="it">Italienisch</option><option value="nl">Niederl?ndisch</option><option value="es">Spanisch</option></select></div>Powered by <span style="white-space:nowrap"><a class="goog-logo-link" href="https://translate.google.com" target="_blank"><img src="https://www.gstatic.com/images/branding/googlelogo/1x/googlelogo_color_42x16dp.png" width="37px" height="14px" style="padding-right: 3px" alt="Google Google übersetzer">Google übersetzer</a></span></div></div></div></section>
BAD:
<section id="glt_widget-2" class="widget widget_glt_widget"><div class="widget-wrap"><div id="flags" class="size18"><ul id="sortable" class="ui-sortable" style="float:left"><li id="Dutch"><a href="#" title="Dutch" class="nturl notranslate nl flag Dutch" data-lang="Dutch"></a></li><li id="English"><a href="#" title="English" class="nturl notranslate en flag English" data-lang="English"></a></li><li id="French"><a href="#" title="French" class="nturl notranslate fr flag French" data-lang="French"></a></li><li id="German"><a href="#" title="German" class="nturl notranslate de flag German" data-lang="German"></a></li><li id="Italian"><a href="#" title="Italian" class="nturl notranslate it flag Italian" data-lang="Italian"></a></li><li id="Spanish"><a href="#" title="Spanish" class="nturl notranslate es flag Spanish" data-lang="Spanish"></a></li></ul></div><div id="google_language_translator" class="default-language-en"><div class="skiptranslate goog-te-gadget" dir="ltr" style=""><div id=":0.targetLanguage" class="goog-te-gadget-simple" style="white-space: nowrap;"><img src="https://www.google.com/images/cleardot.gif" class="goog-te-gadget-icon" alt="" style="background-image: url("https://translate.googleapis.com/translate_static/img/te_ctrl3.gif"); background-position: -65px 0px;"><span style="vertical-align: middle;"><a aria-haspopup="true" class="goog-te-menu-value" href="javascript:void(0)"><span>Sprache ausw?hlen</span><img src="https://www.google.com/images/cleardot.gif" alt="" width="1" height="1"><span style="border-left: 1px solid rgb(187, 187, 187);">?</span><img src="https://www.google.com/images/cleardot.gif" alt="" width="1" height="1"><span aria-hidden="true" style="color: rgb(118, 118, 118);">▼</span></a></span></div></div></div></div></section>
regards
Mark
-
This reply was modified 4 years, 10 months ago by
mark2048.