DEVPPL
http://www.devppl.com/forum/

Javascript browser compatability issues.
http://www.devppl.com/forum/viewtopic.php?f=49&t=13706
Page 1 of 1

Author:  zonerdck [ Thu Jun 18, 2009 6:26 am ]
Post subject:  Javascript browser compatability issues.

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>

Author:  rangana [ Mon Jun 22, 2009 7:40 am ]
Post subject:  Re: Javascript browser compatability issues.

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.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/