Table Row... Show an alert onClick - html

Hello I have a simple HTML table with several rows. I want to alert the user with a message when they click on a particular row. Here is what I tried to get this to work...
<tr onClick="alert(some Message)">
<td>${o.hospitalId}</td>
<td>${o.name}</td>
<td>${o.address}</td>
</tr>
However, that is not working. Am I missing some HTML basics here?

seems to be ok, but try:
<tr onclick="javascript:alert('something');">
or try jquery:
$("tr").click(function () { alert("something"); });

Code seems to be good, of course if you want display literary 'some Message' text it must be between ' and ', like in lante's example. If it won't work still, you can have javascript disabled in browser settings.

add these 'some message' and then it will work fine
<tr onClick="alert('some Message')">
<td>${o.hospitalId}</td>
<td>${o.name}</td>
<td>${o.address}</td>
</tr>

Some Message should be single quotes ' text ' reason behind your alert not working
<table>
<tr>
<td onclick="alert('You are clicking on the cell EXAMPLE')"> Data </td>
</tr>
</table>

Related

jupyter notebook html table cannot display

why jupyter notebook cannot display html 'table', but other html elements are okay, and how can I solve this problem?
below is my source code and my result
source code
<table style="width:20%">
<tr>
<td> **L1** </td>
<td> 1.1 </td>
</tr>
</table>
result
<tr>
<td> **L1** </td>
<td> 1.1 </td>
</tr>
it only removes tag <table> and does nothing else.
That's interesting, because the table (created by pasting your code) comes out just fine for me:
From my personal experience, I can definitely say that Markdown in jupyter notebooks is somehow volatile/unpredictable when it comes to HTML. For example, I myself have been looking for a fix for Jupyter just arbitrarily doing line breaks in the table header (esp. in formulas) and I have found this fix, but it doesn't work for me at all.
I know this is not particularly helpful, but at least it demonstrates that the table not being rendered correctly in your case was either some unexpected behaviour or some bug which maybe, or maybe not, has been fixed in the course of the last year.
You can also add the magic command before the table tag, which worked for me.

ng-bind-html with html + angularjs inside

In one of the pages of my app, I am using ng-bind-html to show some text through a function:
<ng-bind-html
ng-bind-html="getText(textContainer)">
</ng-bind-html>
getText() returns some text which is html code + some angularjs, something like:
<table>
<tbody>
<tr>
<td>
SOME TEXT
<textarea data-ng-bind-html="getOtherText(index)" data-ng-keyup="updateOtherText(index)</textarea>
</td>
</tr>
</tbody>
</table>
Now, I don't know if this is feasible (I am aware that it could be not particular good), but the second bind and the keyup don't seem to fire. Could someone explain me why please?

AMPScript: trying to insert hidden fields

I'm working on some email that will be deployed via Exact Target. We have a lot of AMPScript dictating what is going on within the email(s). The content blocks of the email are dynamically filled, and when a field is left empty there is still a call made to that table section, which then inserts a blank space on the email. Thus throwing the design out of whack.
My question is, is there anyway I can have those empty cells completely removed from the page when not in use?
here is the code sample ...
Set #SendLog_blockC1 = lookup("RaceDataSendLog","BLK_C1","SubID",#SubLookup,"JobID",#JobLookup,"BatchID",#BatchLookup)
...
...
...
Set #blockC1 = Concat("My Contents\Newsletter\",#SendLog_blockC1)
....
....
....
....
%%[IF empty(#blockC1) THEN]%%
%%[ELSE]%%
<tr>
<td align="left" valign="top" >
%%=ContentAreaByName(#blockC1,"",0)=%%
</td>
</tr>
%%[ENDIF]%%
Thank you in advance.
On the assumption you're referring to that space above your ELSE - this should work:
<!--%%[
IF empty(#blockC1) THEN
ELSE]%%-->
<tr>
<td align="left" valign="top" >
%%=ContentAreaByName(#blockC1,"",0)=%%
</td>
</tr>
<!--%%[ENDIF]%%-->
This will hide the AMPscript in the HTML, in addition - you don't really need the IF to produce the space, you can just have the ELSE right after it.
and thank you for your responses. I was finally able to resolve the issue of the extra spacing.
What I did was remove the <tr> and <td> tags from around the if/else statements. I then placed those <tr> and <td> tags around the content blocks that are brought in by the PM's when they decide which blocks to use. This solved the problem of the extra spacing. Client is happy!!!
Thanks again guys!!!

Newsletter layout crashes with Gmail

I've actually created a template on Mailchimp. I used a basic template of Mailchimp and transformed it into the design they gave me. I used the the CSS inline tool of Mailchimp to insert all the code in an inline mode as Gmail does not accept any style on the header. I only have this issue on Gmail, the rest work perfectly. What can I do?
As the code is long I inserted it in a fiddle if you wish to check it out:
http://jsfiddle.net/z27Bw/
I need an answer as its a mystery for me!
You have 2 unclosed <td> tags in the HTML -- one on line 476, one on 482. That might be what's causing the issue in Gmail. If that doesn't fix it, I'd say yeah, it might be a colspan issue.
you can try this
Write first tr code like this
<tr>
<td colspan="2" height="281"> </td>
</tr>
instead of
<tr>
<td width="35" height="281"> </td>
<td class="headerContent"> </td>
</tr
>
and then put that big header image inside it.

How do I grab info from source code from other site?

Is there a way to grab things out of the source code of another site directly into your site?
For example, let's say than in a site the following source code exists:
<table ...>
<tr>
<td class=...>...</div></td>
</tr>
<tr>
<td class=....><div align="... class=...>"Interesting string that keeps changing"</div></td>
</tr>
</table>
And we want that Interesting string that keeps changing to appear in our website as well.
you could use php
you use
$html = file_get_contents('url to website');
or use a hidden if you want a javascript function, and then just grab the innerhtml