It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

Javascript browser compatability issues.

Javascript browser compatability issues.

Postby zonerdck on Thu Jun 18, 2009 6:26 am

Hey I have two small pieces of javascript below right now it only really works in IE. Safari cant handle it neither can chrome among others. I am just wondering why also I have the jquery library and wanted to know if somebody knew how to add a little animation simply. Also right now I just threw it in the body for testing but I am going to put in the head soon. Basically it just resizes a text box and the div containing it. I would also be open to a better solution if anybody knows of one...Thanks.


<script type="text/javascript">
function changeHeight(elemId, h){
var elem = document.getElementById(elemId);
elem.style.height = h;
}
</script>

<script type="text/javascript">
function changeHeight2(elemId, h){
var elem = document.getElementById(elemId);
elem.style.height = h;
}
</script>


<div id='statusinput' style="height:38px;">

<!--<div style="width:60px;float:left;padding-right:5px;"><a href="{$url->url_create('profile',$user->user_info.user_username)}"><img src='{$user->user_photo("./images/nophoto.gif",TRUE)}' class='photo_fr' width='60px' border='0' alt='' /></a></div>-->

<div style="width:442px; float:left; padding:5px 0px 8px 0px;">

<!--<a href="{$url->url_create('profile',$user->user_info.user_username)}">{$user->user_displayname}</a> would like to announce...<br/>-->

<!--input type="textarea" rows='2' onkeypress='return ( (new Event(event)).key=="enter" ? SocialEngine.Viewer.userStatusChangeSubmit() : true );' style="margin: 2px 0px;" size="75" value="" maxlength="100" id="status_new" name="status_new" class="text_small"/-->

<textarea onclick="this.cols=40;this.rows=3; changeHeight('statusinput', 65);"
onblur="this.cols=40;this.rows=1; changeHeight2('statusinput', 38);" type="text"name="status_new" cols="40" rows="1" id="status_new" style="overflow: visible; word-wrap: break-word; word-break: normal; scroll:auto; vertical-align:middle; width:100%" onclick="if($('status_new').value=='{if $owner->user_info.user_status}{$owner->user_info.user_status}{else}What would you like to announce?{/if}')$('status_new').select();" onkeyup="countComment()" onmouseup="countComment()">{if $owner->user_info.user_status}{$owner->user_info.user_status}{else}What would you like to announce?{/if}</textarea>


</div>
zonerdck
 
Posts: 2
Joined: Wed Feb 25, 2009 7:00 am

Re: Javascript browser compatability issues.

Postby rangana on Mon Jun 22, 2009 7:40 am

Try to get Firebug, it will let you know the exact cause of the Error.

Also, I assume that you're running under smarty template right?, You should ensure that you place the script tags under "literal" blocks

Hope that helps.
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines


Who is online

Users browsing this forum: No registered users and 8 guests