/    Sign up×
Community /Pin to ProfileBookmark

JavaScript blockd in IE

Hi,

I am using javascript to implement TypeWriter Effect in the page but problem is JS is being blocked by IE. How to solve this? The code is given below.

<html>
<head>
<SCRIPT LANGUAGE=”JavaScript”>
<!–
var text=”content of text here”;
var delay=50;
var currentChar=1;
var destination=”[not defined]”;
var t;

function type(){
if (document.getElementById){
var dest=document.getElementById(destination…
if (dest)
{
dest.innerHTML=text.substr(0, currentChar);
currentChar++;
if (currentChar>text.length)
{
currentChar=1;
clearTimeout(t);
}
else
{
t=setTimeout(“type()”, delay);
}
}
}
}
function startTyping(textParam, delayParam, destinationParam){
text=textParam;
delay=delayParam;
currentChar=1;
destination=destinationParam;
type();
}
–>
</SCRIPT>
</head>

<body>
<DIV ID=”dispData”></DIV>
<IMG SRC=”img.jpg” onMouseOver=”startTyping(‘This is my introduction’,50,’dispData’)”>
</body>
</html>

There are some more java script to set content at the run time when user clicks somthing and so on. They are also being blocked. Please help solving problem.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisJan 15.2008 — If you are asking about IE7, then the answer lies in the browser, not the javascript. You have to add the site to the user's "trusted zone".
Copy linkTweet thisAlerts:
@Mr_JJan 15.2008 — Are you sure it is being blocked and not just throwing up an error because this line

var dest=document.getElementById(destination...

should be

var dest=document.getElementById(destination)
Copy linkTweet thisAlerts:
@magentaplacentaJan 15.2008 — Also, if you're by chance getting that yellow bar at the top of your IE window (at least in IE 6) you can do the following:

1) Click &#8220;tools&#8221; menu in IE

2) Select &#8220;internet options&#8221;

3) Click the &#8220;advanced&#8221; tab

4) Scroll down to the &#8220;security&#8221; section and check &#8220;allow active content to run in files on My Computer&#8221;
×

Success!

Help @rahiparikh spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...