luke2012 Well-Known Member Licensed User Longtime User Jul 7, 2014 #1 Hi to all, I'm implementing a web app using Web socket classes and HTML5 + JQuery as front end. I'm using a DIV within the HTML5 page in order to show the HTML table returned by the ExecuteHTML within the called Web socket class. The html inside the DIV is populated using .SetHtml(html) within the Web socket class. The problem is that I'm not able to access the table rows using the standard Jquery selectors and methods. Any suggestions ?
Hi to all, I'm implementing a web app using Web socket classes and HTML5 + JQuery as front end. I'm using a DIV within the HTML5 page in order to show the HTML table returned by the ExecuteHTML within the called Web socket class. The html inside the DIV is populated using .SetHtml(html) within the Web socket class. The problem is that I'm not able to access the table rows using the standard Jquery selectors and methods. Any suggestions ?
B billzhan Active Member Licensed User Longtime User Jul 7, 2014 #2 You can add a row clickable in the table, and add <a href=“http:\\www.idxxx.com”> to it. When a link was clicked, you can catch the href ,and parse the id. Upvote 0
You can add a row clickable in the table, and add <a href=“http:\\www.idxxx.com”> to it. When a link was clicked, you can catch the href ,and parse the id.
S sorex Expert Licensed User Longtime User Jul 7, 2014 #3 it seems the dom doesn't get updated right so jquery doesn't find what you need (or you have actual bugs) try something like <tr onclick=myfunction(yourid);> instead Upvote 0
it seems the dom doesn't get updated right so jquery doesn't find what you need (or you have actual bugs) try something like <tr onclick=myfunction(yourid);> instead
luke2012 Well-Known Member Licensed User Longtime User Jul 7, 2014 #4 Thanks 4 the reply! It works fine. I have only a problem with the parameters. When I pass a string that contains blank chars the js raise an error : B4J code Code: Copy sb.Append("<tr onClick=myfunction('" & cur.GetString2(1) & "'); >") JS code Code: Copy function myfunction (par){ alert(par); } I got the following error "Uncaught SyntaxError: Unexpected token ILLEGAL" because as function parameter I pass a string with whitespaces. Last edited: Jul 7, 2014 Upvote 0
Thanks 4 the reply! It works fine. I have only a problem with the parameters. When I pass a string that contains blank chars the js raise an error : B4J code Code: Copy sb.Append("<tr onClick=myfunction('" & cur.GetString2(1) & "'); >") JS code Code: Copy function myfunction (par){ alert(par); } I got the following error "Uncaught SyntaxError: Unexpected token ILLEGAL" because as function parameter I pass a string with whitespaces.
S sorex Expert Licensed User Longtime User Jul 8, 2014 #5 It shouldn't do that, you only need to cover that when sending it over as query string. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 8, 2014 #6 Note that it is better to post this question in the B4J forum. I recommend you to use the template engine to build the strings: [WebApp] (mini) Template Engine Upvote 0
Note that it is better to post this question in the B4J forum. I recommend you to use the template engine to build the strings: [WebApp] (mini) Template Engine