|
Posted by JamesBenson on 09/28/27 11:18
Hello, what exactly do you mean when you say break the browser, if its a
PHP error you get then its something to do with PHP, however, your
javascript is not correct and produces errors, im not too good at
javascript but know when I see an error, i could be wrong but dont think
its possible to have code like your example, I modified it a little to
get rid of the error:-
<a href="#" onclick='document.form1.how.value="Pulmonary edema is a
condition in which fluid accumulates in the lungs, usually because the
heart\'s left ventricle does not pump adequately. In cases of severe
pulmonary edema, the symptoms will worsen and include A drop in blood
pressure resulting in a thready pulse.";'>
Like I say though unless your error is PHP related then its most likely
your javascript code but I could be wrong,
Hope that helps.
Leila Lappin wrote:
> Hello all,
>
> I hope this hasn’t been answered a zillion times already, I've tried
> everything I know and nothing has worked. The following is the PHP statement
> and the HTML rendering. The apostrophe is displayed as is and breaks the
> browser. May be I am wrong but I was under the impression that escaping
> special characters with one of the these, htmlspecialchars, htmlentities,
> and addslashes would replace them with encoded (hex?) value so they wont
> break the browser. But it hasn’t worked that way. I am using
> charset=iso-8859-1. This is my PHP:
>
> === This is the PHP ===
> <li>
> <a href="#"
> onclick='document.form1.how.value="<?=htmlentities($row['how'])?>";
> document.form1.factor.value="<?=addslashes($row['factor'])?>";document.form1
> ..submit();'><?= addslashes($row['factor'])?>
> </a>
> </li>
>
> ====== This is the rendering =======
> ====== (note the heart's apostrophe breaks IE and firefox) ===
> <li>
> <a href="#" onclick='document.form1.how.value="Pulmonary edema is a
> condition in which fluid accumulates in the lungs, usually because the
> heart's left ventricle does not pump adequately. In cases of severe
> pulmonary edema, the symptoms will worsen and include A drop in blood
> pressure resulting in a thready pulse.";
> document.form1.factor.value="Pulmonary
> edema";document.form1.submit();'>Pulmonary edema
> </a>
> </li>
Navigation:
[Reply to this message]
|