Javascript help please

Soldato
Joined
10 Jun 2003
Posts
4,615
Location
New Zealand
looking for some advice if possible, I know next to nothing about js so this has got me stumped but I can't help but think there must be an answer.

The code below appears ~100 times in each page

<script type="text/javascript">
$(function() {
$('#otherdetails_247').ready(function() {
$('#otherdetails_247').height($('#wrapper_247').height());
});

$('#assingeddetails_247').ready(function() {
$('#assingeddetails_247').height($('#assignedname_247').height());
$('#assigned_247').height($('#assingeddetails_247').height());
});

});
</script>

I want to call this from an external js file but the numbers change each time, is there a way to call this whilst changing the numbers using some form of argument passed to the function?

I know that the assingeddetails is spelt wrong but I have inherited this code so can't change that easily!
 
the page is only available via a secure login so no can do I'm afraid :(

there are quite a few similar code fragments like this and most are just related to onscreen formatting and I don't need to change how they act. I just want to reduce the size of the page (currently over 2MB!) and I was just wondering if there was anyway that I could call with an argument of 247 which would replace xxx below.

$(function() {
$('#otherdetails_xxx').ready(function() {
$('#otherdetails_xxx').height($('#wrapper_xxx').he ight());
});

$('#assingeddetails_xxx').ready(function() {
$('#assingeddetails_xxx').height($('#assignedname_ xxx').height());
$('#assigned_xxx').height($('#assingeddetails_xxx' ).height());
});

});
 
from what I can get from the other people here it is used to set heights, apparently this can't be done in css correctly due to the content (how true this is I don't know).

It is using jquery yes, sorry for my lack of knowledge here, I am a js virgin!
 
Back
Top Bottom