The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Javascript syntax
Christian J
post Sep 20 2006, 04:50 AM
Post #1


.
********

Group: WDG Moderators
Posts: 8,043
Joined: 10-August 06
Member No.: 7



In another topic this iframe script was mentioned: http://www.phpmix.org/iframe_height_auto_r...resize_the_code

Some of its syntax looks unfamiliar to me. What is it called, and could someone explain it?

Example 1:

CODE
var DYNIFS = {
    // Storage for known IFrames.
    iframes: {},
    // Here we save any previously installed onresize handler.
    oldresize: null,
    
    ...etc


Example 2:

CODE
onresize: function() {
    ...etc
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Sep 20 2006, 06:40 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,298
Joined: 31-August 06
Member No.: 43



QUOTE(Christian J @ Sep 20 2006, 06:50 PM) *

In another topic this iframe script was mentioned: http://www.phpmix.org/iframe_height_auto_r...resize_the_code

Some of its syntax looks unfamiliar to me. What is it called, and could someone explain it?

Example 1:

CODE
var DYNIFS = {
    // Storage for known IFrames.
    iframes: {},
    // Here we save any previously installed onresize handler.
    oldresize: null,
    
    ...etc


DYNIFS is an object, and this is an "object literal" - in other words you're just building the object from constant values. Try Chapter 8 of the Flanagan book if you have it.


Example 2:

CODE
onresize: function() {
    ...etc



Oh, well I suppose this is within another object declaration, where one property of the object is a function.

OOPS! (Sorry, don't know the smilies very well, so here's a random selection... ohmy.gif glare.gif angry.gif dry.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th February 2019 - 04:48 AM