-3

I have an onclick on a button but it is not working properly.

<a href="javascript:void(0)" class="button" onclick=\'websiteopen("'.$site->page_id.'","fb"), PopupCenter("http://nullrefer.com/?'.$site->facebook.'","Website", "'.$site->id.'", "'.$site->title.'", 1000,500,"fb");jqxAlert.alert("Verifying..<img src=\'http://website.com/_template/images/load.gif'>");$(this).fadeOut().delay(4100).fadeIn();\'><b class="glyphicons thumbs_up" style="height:8px;vertical-align:baseline;padding:2px 9px"><i></i></b> '.$lang['sp17'].'</a>

It is something wrong in this part of the code:

jqxAlert.alert("Verifying..<img src=\'http://website.com/_template/images/load.gif'>");

What is the issue?

Bijan
  • 7,737
  • 18
  • 89
  • 149
XDesign
  • 1
  • 3

2 Answers2

1

You formatting is wrong, it needs to be as follows:

<a href="javascript:void(0)" class="button" onclick="jqxAlert.alert('Verifying...')">
    <img src="_template/images/load.gif" height="16px">
</a>

Edit: This answer assumes that the code above is using a plugin that behaves in a similar manner to the window.alert(); similar to something like this -> http://www.jqwidgets.com/jquery-alert-popup/

Alex Baulch
  • 751
  • 1
  • 11
  • 24
  • Considering that this is a js alert box (not the window.alert function) (it appears to be something like a jquery alert). If so it would likely be able to accept the image tag (and other html) as part of the text. – Jonathan Kuhn May 11 '15 at 21:12
  • Agreed, but I did a quick search for the plugin (found this: http://www.jqwidgets.com/jquery-alert-popup/) which appears to just be a styled equivalent of the js window.alert(); I will add the reference to make this clear – Alex Baulch May 11 '15 at 21:16
  • Feel like giving anymore details than that? – Alex Baulch May 11 '15 at 21:23
  • You haven't made any of the changes I suggested, so it's still broken – Alex Baulch May 11 '15 at 21:29
0

be carefull with the double quotes. In html you can write simple quotes inside double quotes and it is translate good.

');"

Or use functions:

Functions on clic

Community
  • 1
  • 1
bugs2919
  • 371
  • 1
  • 8