-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?

5
  • you need to learn basic Javascript string syntax... Commented May 11, 2015 at 21:06
  • what's your text part for this href? Commented May 11, 2015 at 21:06
  • You need to put the onclick value inside quotes (most likely single quotes), you need to close the <a tag (missing >), you need some text in the <a> tag. Commented May 11, 2015 at 21:09
  • @zairwolf added more details tnx Commented May 11, 2015 at 21:26
  • @XDesign you should simplify your question. Also make sure if its about HTML or PHP. Commented May 11, 2015 at 21:31

2 Answers 2

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/

Sign up to request clarification or add additional context in comments.

4 Comments

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.
Agreed, but I did a quick search for the plugin (found this: 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
Feel like giving anymore details than that?
You haven't made any of the changes I suggested, so it's still broken
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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.