/    Sign up×
Community /Pin to ProfileBookmark

onChange= not functon but script

Hi there,
I wanna know if there is any way to implement onChange etc statement, which is not function, but code, written in an external file like:
onChange=<script type=”text/javascript” src=”external.js”></script>

[CODE]onChange=<script type=”text/javascript” src=”external.js”></script>[/CODE]

so onChange me to get the result of that external.js executed?

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@blue-eye-labsJan 23.2010 — No. It doesn't logically follow that such would be possible. These aren't server side scripts.

Why not just define a function in external.js and execute that "onChange"?
Copy linkTweet thisAlerts:
@blue-eye-labsJan 23.2010 — Well, actually there is kind of a way, but it involves evaluating the response of an AJAX request.
Copy linkTweet thisAlerts:
@pastet89authorJan 23.2010 — lol, that's the whole point ?

1) I want to avoid using AJAX, because I can not get it working in IE.

2) Why not just define a function in external.js and execute that "onChange"? [/QUOTE]
Because external.js is using the ACD (AJAX CROSS DOMAIN) technology to do the task which AJAX can not, and return me the result. If you are familiar with ACD you must know that the content of external.js is written not in JavaScript, but in Perl and it just can be called from outside like external Javascript file ?
Copy linkTweet thisAlerts:
@Declan1991Jan 23.2010 — If you are familiar with ACD you must know that the content of external.js is written not in JavaScript, but in Perl and it just can be called from outside like external Javascript file ?[/QUOTE]

That's irrelevant. It may be a Perl script, but it has to generates JavaScript to be used by the browser. Or any other client side language, but I presume JavaScript is the one.
Copy linkTweet thisAlerts:
@blue-eye-labsJan 23.2010 — That's irrelevant. It may be a Perl script, but it has to generates JavaScript to be used by the browser. Or any other client side language, but I presume JavaScript is the one.[/QUOTE]

Declan is right. You can still generate your Javascript by server side scripting in whatever language you choose and include it the normal way. It still has to be javascript for javascript to use it.
Copy linkTweet thisAlerts:
@A1ien51Jan 23.2010 — So you create a function on the page that does the cross domain call. It is not rocket science. And FF3.5 and IE8 both support cross domain Ajax calls. Look into CORS.

Eric
×

Success!

Help @pastet89 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.16,
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,
)...