In-line JS changed after upgrade
Posted: 07 July 2005 10:49 AM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  112
Joined  06-13-2003

This worked in an entry before the upgrade:

<script type="text/javascript">
//<![CDATA[
var mailnostril="[at]"

for (i=0; i<=(document.links.length-1); i++){
if (document.links[i].href.indexOf(mailnostril)!=-1)
document.links[i].href=document.links[i].href.split(mailnostril)[0]+"@"+document.links[i].href.split(mailnostril)[1]
}
//]]>
</script>

But now it’s being output with the square brackets changed to…uh…senior moment…what the hell are those things called…? Angled brackets? Here, I’ll paste it in from the source code of the output page:

<script type="text/javascript">
//<![CDATA[
var mailnostril="[at]"

for (i=0; i<=(document.links.length-1); i++){
if (document.links<i>.href.indexOf(mailnostril)!=-1)
document.links<i>.href=document.links<i>.href.split(mailnostril)[0]+"@"+document.links<i>.href.split(mailnostril)[1]
}
//]]>
</script>

Think this is just an isolated thing? You’ll notice that not all brackets get changed…it’s just the four that EE apparently thinks are what…html for italics?

<i>

I’m a little concerned now because I’ve been working on this site for so long that I can’t even begin to remember where else this problem might also be cropping up. But, like I said, the above worked before the upgrade, if that helps in tracking it down or guiding me to a happy resolution. Thanks :-)

Profile
 
 
Posted: 07 July 2005 09:47 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  112
Joined  06-13-2003

I’m sorry…I hate doing this but I have to go live with this site next Thursday.

I have this awful habit of taking 80 paragraphs to say what could be conveyed in one sentence so let me try to simplify my question:

If I publish an entry with this in the javascript code within said entry:

[i]

EE converts it on page output to this:

<i>

...which screws everything up.

How do I make EE stop doing this?

Profile
 
 
Posted: 07 July 2005 09:50 PM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

Someone posted about this due to wanting to pose code snippets of arrays. I think the solution was to hack one of the files and edit out the bbcode processing.  I’ll try to find the thread, but I can’t remember where it was.

 Signature 
Profile
MSG
 
 
Posted: 07 July 2005 09:51 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

I think it was this thread.

 Signature 
Profile
MSG
 
 
Posted: 07 July 2005 11:06 PM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

You could also simply edit the javascript to use a different variable than “i”.  Pretty much anything but “i”, “b”, and maybe “u” ought to work.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66467 Total Logged-in Users: 28
Total Topics: 84860 Total Anonymous Users: 14
Total Replies: 455330 Total Guests: 165
Total Posts: 540190    
Members ( View Memberlist )