php - Onclick event not working with AJAX -


i want display selected image's slideshow of ajax , fetching of title important display corresponding slideshow in javascript, title of clicked image not fetching.

javascript:

function slide(s) {     var _event = s;     alert(_event); } 

code:

<div id="inner_body">     <?php     $c = mysql_connect("localhost", "abc", "xyz");     mysql_select_db("root");     $sql = "select * images year=2000";     $qc = mysql_query($sql);     $count = 0;     while ($ans = mysql_fetch_array($qc)) {         $title = ucwords($ans['event']);         print "              <div class='img-wrap' onclick='slide($title)'>                 <img id='display_img' src='images/thumbnails/$ans[image1]'>                 <div class='img-overlay'>                     <b1>" . $title . "</b1>                 </div>             </div>";     }     ?> </div> 

missing quotes tag

onclick='slide($title)'; //render onclick='slide(xxxx)' //should onclick='slide(\"$title\")'; //render onclick='slide("xxxx")' 

ps.

image tag must closed <image /> or <image></image>

<b1> undefined(also <b></b> outdated legacy html). should <strong>...</strong>


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -