Tuesday, 15 June 2010

hyperlink - Grabbing onClick Value with PHP -


I am working on a small project, where I am trying to capture click value with HTML code . Unfortunately, after reading some posts, I should use pre_match, did not work.

Perhaps someone can help me here and can help me?

  & lt; Div class = "result" & gt; & Lt; Table & gt; & Lt; Tbody & gt; & Lt; Tr class = "resultName" & gt; & Lt; TD & gt; 1 & lt; / TD & gt; & Lt; TD & gt; 2 & lt; / TD & gt; & Lt; TD & gt; 3 & lt; / TD & gt; & Lt; TD & gt; 4 & lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 1stText & lt; / TD & gt; & Lt; TD & gt; 2ndText & lt; / TD & gt; & Lt; TD & gt; 3rdText & lt; / TD & gt; & Lt; TD & gt; 4thText & lt; / TD & gt; & Lt; Td> & Lt; A href = "#" onclick = "openWin ('/ link.html', 'result', {width: 341, height: 550}); return returned;" & Gt; Results & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Div & gt;  

I was only able to get the text content "result"

P.S. One way was found:

  $ linkcounter = 0; $ Links = $ dom- & gt; GetElementsByTagName ('A'); Foreign exchange ($ link $ as link) {if ($ link-> getAttribute ('href') == "#" and $ link-> getAttribute ('onclick')) {echo " Linkcounter - "$ Linkcounter. "". $ Link- & gt; GetAttribute ('onclick'). "& Lt; / br & gt;"; $ Linkcounter ++; }}  

just try

  & lt ; A href = "#" class = "get_value" onclick = "openWin ('/ link.html', 'result', {width: 341, height: 550}); return back; & Gt; Results & lt; / A & gt; Click  

and in JS

  $ (function () {$ (".get_value") (function () {var onclickValue = $ (this ) .attr ("onclick");})})  

No comments:

Post a Comment