/    Sign up×
Community /Pin to ProfileBookmark

JS File code repeated twice

On my web page, I have included some JS files.

when I load this in the browser and check the JS file code, the code is duplicated twice. The whole code is repeated.

I could not understand why this is happening. I checked this in Both IE and Fire fox and the result is same.

Can anybody explain why this is happening?

Thanks
Lalit

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 07.2010 — post a link to a test page. Or post the code. HTML code included.
Copy linkTweet thisAlerts:
@lalitbhatiaauthorJul 07.2010 — The website is created in sitecore and ASP.Net. It is an existing application.

The code is huge and can't be added in this post. unfortunately there is no live access as well ?

The aspx Code I wrote just included some js files and the Js file has just some functions.

Other js files are jquery.js, shadowbox.js.

I have also verified that there is no src or href that are set to blank strings.

I am seeing this issue in every page and for every js file.
Copy linkTweet thisAlerts:
@PadonakJul 07.2010 — this is caused by your server-side script
Copy linkTweet thisAlerts:
@lalitbhatiaauthorJul 07.2010 — Then how can I avoid this? as we can not remove server side scripts from the code.

I mean are there any best practices to avoid such issues?

This issue causing the functions (that I want to call on page request) to call twice and I have to take flags to check before executing the code inside them.
Copy linkTweet thisAlerts:
@KorJul 07.2010 — Then how can I avoid this? as we can not remove server side scripts from the code.

I mean are there any best practices to avoid such issues?

This issue causing the functions (that I want to call on page request) to call twice and I have to take flags to check before executing the code inside them.[/QUOTE]

How could we know? You provided no code, no link, no nothing. It is probably the ASP.NET codes which are written incorrectly. You should make something to correct that server-side code. What else do you think it is to be done? If a code writes something twice, you should check [I]that[/I] code.
×

Success!

Help @lalitbhatia 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 6.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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