D
david.karr
Ok, I'm sure that subject is confusing, but I noticed the following
curious code on the main page of the "Vitamin" web developer's page
<http://www.thinkvitamin.com/>:
<script type="text/javascript">
//<![CDATA[
(function(id) {
document.write('<script type="text/javascript" src="' +
'http://www.northmay.com/deck/deck' + id + '_js.php?' +
(new Date().getTime()) + '"></' + 'script>');
})("VM");
//]]>
</script>
The key thing I noticed is that this is defining an inline function,
and calling it immediately. This is a very curious technique. I
could almost see doing this if you had several repeated strings you
wanted to substitute, but this example only uses the func parameter
once.
Otherwise, what is the point of doing it this way?
curious code on the main page of the "Vitamin" web developer's page
<http://www.thinkvitamin.com/>:
<script type="text/javascript">
//<![CDATA[
(function(id) {
document.write('<script type="text/javascript" src="' +
'http://www.northmay.com/deck/deck' + id + '_js.php?' +
(new Date().getTime()) + '"></' + 'script>');
})("VM");
//]]>
</script>
The key thing I noticed is that this is defining an inline function,
and calling it immediately. This is a very curious technique. I
could almost see doing this if you had several repeated strings you
wanted to substitute, but this example only uses the func parameter
once.
Otherwise, what is the point of doing it this way?