Anybody can help mi on this, { ' } thing.
It's will display an IE error box whenever I refreshes.
Pls help !!![]()
<td class="RowGrey" height="19"><a href="#" onClick="displayOnForm(
'dog's'');"> - </a> </td>
Anybody can help mi on this, { ' } thing.
It's will display an IE error box whenever I refreshes.
Pls help !!![]()
<td class="RowGrey" height="19"><a href="#" onClick="displayOnForm(
'dog's'');"> - </a> </td>
onClick="displayOnForm(
'dog's'');"
That's likely the issue.
You should escape the single quotes you want displayed--
'dog\'s'
(What's the second single quote doing at the end of that?)
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
sorry to bother again.
The contents within displayOnForm() is generated during runtime.
So how can I change from { 'dog's'', } --> { 'dog\'s\'', } by using the function changeApostrophe()??
Example like for the attribute = lastName
Thanks once again.
function changeApostrophe(text){
var newString = "";
for (var i = 0; text.indexOf("'") >= 0; i++) {
var index = text.indexOf("'");
var firstHalf = text.substring(0, index);
newString = newString + firstHalf + "'";
text = text.substring(firstHalf.length + 1, text.length);
}
newString += text;
return newString;
}
<td class="<cc:altColor/>" height="19"><a href="#" onClick="displayOnForm(
'<cc:corpItemAttribute attribute='rowNo'/>','<cc:corpItemAttribute attribute='salutationId'> - <cc:staticModelItemAttribute modelalias='cc.salutation'/></cc:corpItemAttribute>',
'<cc:corpItemAttribute attribute='industryId'> - <cc:staticModelItemAttribute modelalias='cc.industry'/></cc:corpItemAttribute>',
'<cc:corpItemAttribute attribute='lastName'/>',
'<cc:corpItemAttribute attribute='personnelId'> - <cc:staticModelItemAttribute modelalias='cc.personnel'/></cc:corpItemAttribute>',
'<cc:corpItemAttribute attribute='firstName'/>','<cc:corpItemAttribute attribute='middleName'/>',
'<cc:corpItemAttribute attribute='officeNo'/>','<cc:corpItemAttribute attribute='faxNo'/>',
'<cc:corpItemAttribute attribute='mobtelNo'/>','<cc:corpItemAttribute attribute='email'/>',
'<cc:corpItemAttribute attribute='homeNo'/>',
'<cc:corpItemAttribute attribute='createUserId'> - <cc:staticModelItemAttribute modelalias='cc.userid'/></cc:corpItemAttribute>',
'<cc:corpItemAttribute attribute='createDateTime'/>');">
<cc:corpItemAttribute attribute='firstName'/></a>
</td>
I don't think this is what you're looking for, though. I think you want to be able to pass in an apostrophe-delimited string value containing apostrophes, then convert it. You can't do this, since as soon as it's seen it'll throw a parse error.Code:str = str.replace(/'/g, "\\'");
What's this <cc:> namespace? I'm pretty sure that's not valid HTML. Is it parsed by the Javascript?
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I using a jsp instead of a html. and the cc is a modified tag name. Nothing special about it.![]()
Ah, very well, so it'll be parsed into HTML by a server-side script.
Well, so long as the output doesn't contain any apostrophes, you should be fine. If it does, you'll have to replace them server-side.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
No good, I'm only allow to code on the presentation tier not the business 1.
Below is the output from the server, still got the "Expected )" error from IE.
Oh God!!!!![]()
<td class="RowGrey" height="19"><a href="#" onClick="displayOnForm(
'9',' - ',
' - ',
'dog's'',
'P2 - PERSONNEL 2',
'dog's'','dog's',
'123','',
'123','13@dfg.edfg',
'',
'junyong - Lee Jun Yong',
'11/07/2006 02:30:58 PM');">
- </a>
</td>
<td class="RowGrey" height="19"><a href="#" onClick="displayOnForm(
'9',' - ',
' - ',
'dog's'',
'P2 - PERSONNEL 2',
'dog's'','dog's',
'123','',
'123','13@dfg.edfg',
'',
'junyong - Lee Jun Yong',
'11/07/2006 02:30:58 PM');">
dog's'</a>
</td>
There are still apostrophes there. There's one alternative left, but it's quite ugly:Code:<td class="<cc:altColor/>" height="19"><a href="#" onClick="displayOnForm( "<cc:corpItemAttribute attribute='rowNo'/>","<cc:corpItemAttribute attribute='salutationId'> - <cc:staticModelItemAttribute modelalias='cc.salutation'/></cc:corpItemAttribute>", "<cc:corpItemAttribute attribute='industryId'> - <cc:staticModelItemAttribute modelalias='cc.industry'/></cc:corpItemAttribute>", "<cc:corpItemAttribute attribute='lastName'/>", "<cc:corpItemAttribute attribute='personnelId'> - <cc:staticModelItemAttribute modelalias='cc.personnel'/></cc:corpItemAttribute>", "<cc:corpItemAttribute attribute='firstName'/>","<cc:corpItemAttribute attribute='middleName'/>", '<cc:corpItemAttribute attribute='officeNo'/>","<cc:corpItemAttribute attribute='faxNo'/>", "<cc:corpItemAttribute attribute='mobtelNo'/>","<cc:corpItemAttribute attribute='email'/>", "<cc:corpItemAttribute attribute='homeNo'/>", "<cc:corpItemAttribute attribute='createUserId'> - <cc:staticModelItemAttribute modelalias='cc.userid'/></cc:corpItemAttribute>", "<cc:corpItemAttribute attribute='createDateTime'/>");"> <cc:corpItemAttribute attribute='firstName'/></a> </td>
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I encounter javascript error when the a single input contains both quote and apostrophe. I tried to escape it using \" and &.#.3.9;for apostrophe &.q.u.o.t.;for quote. But no luck!!!
![]()
<input type='hidden' name='rowNoItemAttr' value=\"2 \">
<input type='hidden' name='salutationIdItemAttr' value=\"6 - ARCH"S \">
<input type='hidden' name='industryIdItemAttr' value=\" - "\>
<input type='hidden' name='lastNameItemAttr' value=\"Las't Name" \">
<input type='hidden' name='personnelIdItemAttr' value=\"P2 - PERSONNEL 2 \">
<input type='hidden' name='firstNameItemAttr' value=\"Firs't Nam"e \">
<input type='hidden' name='middleNameItemAttr' value=\"Mi'ddle Nam"e \">
<input type='hidden' name='officeNoItemAttr' value=\"2123 \">
sorry guys, my mistake. I found the answer to my question.![]()
Bookmarks