WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Is it possible to rename JS functions?, andy, September 16, 2004
     Re:Is it possible to rename JS functions? , Michael B., September 29, 2004
     Re:Is it possible to rename JS functions? , base, September 28, 2004
     Re:Is it possible to rename JS functions?, dex^, September 17, 2004
         Re:Is it possible to rename JS functions? , Jeffrey Jangli, September 26, 2004
             Re:Is it possible to rename JS functions? , dex^, October 11, 2004
                 Re:Is it possible to rename JS functions? , Jeffrey Jangli, October 14, 2004
         Re:Is it possible to rename JS functions?, habix, September 23, 2004
             Re:Is it possible to rename JS functions?, Andy, October 25, 2004

Subject: Re:Is it possible to rename JS functions? From: habix Date: September 23, 2004

I dont think that would solve anything (not using JS)... You can rename functions with a simple edit/replace in your text editor. Better yet:

Use DHTML behaviors (i guess it's IE only, but read that mozzila is implementing them too): - create a htc file like:

<public:component>
<public:attach event="onmouseover" onevent="_onMIn()" />
<public:attach event="onmouseout" onevent="_onMOut()" />
<script language="JavaScript">
 function _onMIn(){
  element.style.backgroundColor = 'khaki';
 }
 
 function _onMOut(){
  element.style.backgroundColor = 'white';
 }
</script>
</public:component>

define a css clas:

  .hiLiRow{BEHAVIOR:url(htc/hiLihgt.htc);cursor:hand;}

and use a class="hiLiRow" on elements you want to attach this behavior

That way, you define only css class name and attach on all events defined in htc file.

Hope this helps....

HaBiX

From: dex^
Sent: September 18, 2004
Subject: Re:Is it possible to rename JS functions?

Hi,
Is there a way to rename functions to some other name? In a list view I have hundreds of: onmouseenter, if I could rename it to ome() or something like that I would save a bit of bandwidth.
Any ideas?

-----------------------------------------------------------

if you would like to save bandwidth, its better to not use javascript at all, it does not work in every browser, and alot of times it's apsolutly useless.

dex^





Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX