I'm trying to make a script run when you select a link. I have that part working, however I want it to not run when you select the main one (English). I'm sure I'm missing something basic but I have no idea what it could be. Here is what I have so far:
Script:
function disclaimer() {
if ($( "a[title!='English']")) {
alert('Disclaimer here');
}
}
PHP:
$block_content .= '<a href="#top"
onclick="doGTranslate(\''.$gtranslate_main_lang.'|'.$lang.'\');
disclaimer();jQuery(this).parent().parent().find(\'div.selected
a\').html(jQuery(this).html());" title="'.$lang_name.'" class="nturl '.
($current_language == $lang ? ' selected' : '').'"><span class="gflag"
style="background-position:-'.$flag_x.'px -'.$flag_y.'px;"><img
src="'.base_path().drupal_get_path('module', 'gtranslate').'/gtranslate-
files/blank.png" height="16" width="16" alt="'.$lang_name.'" />
</span>'.$lang_name.'</a>';
Produced HTML:
<a href="#top" onclick="doGTranslate('en|en');
disclaimer();jQuery(this).parent().parent().find('div.selected
a').html(jQuery(this).html());" title="English" class="nturl selected">
<span class="gflag" style="background-position:-0px -0px;"><img
src="/sites/all/modules/contrib/gtranslate/gtranslate-files/blank.png"
height="16" width="16" alt="English"></span>English</a>
<a href="#top" onclick="doGTranslate('en|fr');
disclaimer();jQuery(this).parent().parent().find('div.selected
a').html(jQuery(this).html());" title="French" class="nturl "><span
class="gflag" style="background-position:-200px -100px;"><img
src="/sites/all/modules/contrib/gtranslate/gtranslate-files/blank.png"
height="16" width="16" alt="French"></span>French</a>
<a href="#top" onclick="doGTranslate('en|de');
disclaimer();jQuery(this).parent().parent().find('div.selected
a').html(jQuery(this).html());" title="German" class="nturl "><span
class="gflag" style="background-position:-300px -100px;"><img
src="/sites/all/modules/contrib/gtranslate/gtranslate-files/blank.png"
height="16" width="16" alt="German"></span>German</a>
As I said, I want the script to run when French or German are selected, but not English. I've tried several things but nothing seems to work. Any help or point in the right direction is greatly appreciated. If I need to post anything else that might help you, please let me know!