Packageorg.openzet.utils
Classpublic class JSControlUtil

All static utility class to use as a proxy between Flex and Javascript in HTML. Note that this class could cause a runtime error when used without a browser.



Public Methods
 MethodDefined by
  
You cannot make an instance of this class.
JSControlUtil
  
close():void
[static] Closes Javascript function to close window.
JSControlUtil
  
deleteCookie(key:String):void
[static] Deletes a selected cookie
JSControlUtil
  
getCookie(key:String):String
[static] Retrieves cookie by a specific key.
JSControlUtil
  
getCookieAll():String
[static] Retrieves all cookie information.
JSControlUtil
  
getFormData():String
[static] Extracts all form data from an HTML documents as JSON format.
JSControlUtil
  
getInnerHTML(id:String):String
[static] Retrieves inner HTML in a div.
JSControlUtil
  
getInnerText(id:String):String
[static] Retrieves string from a div.
JSControlUtil
  
getSelfAddress():String
[static] Retrieves the current location.
JSControlUtil
  
getStyle(id:String):String
[static] Retrieves specified div's style.
JSControlUtil
  
getUserAgent():String
[static] Retrieves user information.
JSControlUtil
  
isFireFox():Boolean
[static] Verifies whether the current browser is FireFox.
JSControlUtil
  
isGoogleCrome():Boolean
[static] Verifies whether the current browser is Chrome.
JSControlUtil
  
isIE():Boolean
[static] Verifies whether the current browser is Internet Explorer.
JSControlUtil
  
isOpera():Boolean
[static] Verifies whether the current browser is Opera.
JSControlUtil
  
openPopup(URL:String, id:String, param:String = "scrollbars=no,toolbar=no,resizable=no,width=100,height=80,left=0,top=0"):void
[static] Pops up a JavaScript window.
JSControlUtil
  
setCookie(key:String, value:String, expires:Number = -1, path:String = null, domain:String = null, secure:Boolean = false):String
[static] Sets cookie in a browser.
JSControlUtil
  
setInnerHTML(id:String, HTML:String):void
[static] Specifies innerHTML in a div.
JSControlUtil
  
setStyle(id:String, value:Object):String
[static] Sets style for a DIV.
JSControlUtil
Constructor detail
JSControlUtil()constructor
public function JSControlUtil()

You cannot make an instance of this class.

Method detail
close()method
public static function close():void

Closes Javascript function to close window.

deleteCookie()method 
public static function deleteCookie(key:String):void

Deletes a selected cookie

Parameters
key:String — cookie to delete
getCookie()method 
public static function getCookie(key:String):String

Retrieves cookie by a specific key.

Parameters
key:String — key to retrieve.

Returns
String — Returns cookie result retrieved by the key. null, if no result is found.
getCookieAll()method 
public static function getCookieAll():String

Retrieves all cookie information.

Returns
String — Returns current page's all cookie information.
getFormData()method 
public static function getFormData():String

Extracts all form data from an HTML documents as JSON format.

Returns
String — All form data in JSON format, with name:value pairs.
getInnerHTML()method 
public static function getInnerHTML(id:String):String

Retrieves inner HTML in a div.

Parameters
id:String — div's ID

Returns
String — inner HTML of a div
getInnerText()method 
public static function getInnerText(id:String):String

Retrieves string from a div.

Parameters
id:String — div's id

Returns
String — inner text of a div
getSelfAddress()method 
public static function getSelfAddress():String

Retrieves the current location.

Returns
String — Returns the current page's location.
getStyle()method 
public static function getStyle(id:String):String

Retrieves specified div's style.

Parameters
id:String — div's ID

Returns
String — div's style value.
getUserAgent()method 
public static function getUserAgent():String

Retrieves user information.

Returns
String — Returns string representation of user agent.
isFireFox()method 
public static function isFireFox():Boolean

Verifies whether the current browser is FireFox.

Returns
Boolean — true, if current browser is FireFox, otherwise, false.
isGoogleCrome()method 
public static function isGoogleCrome():Boolean

Verifies whether the current browser is Chrome.

Returns
Boolean — true, if current browser is Chrome, otherwise, false.
isIE()method 
public static function isIE():Boolean

Verifies whether the current browser is Internet Explorer.

Returns
Boolean — true, if current browser is IE, otherwise, false.
isOpera()method 
public static function isOpera():Boolean

Verifies whether the current browser is Opera.

Returns
Boolean — true, if current browser is Opera, otherwise, false.
openPopup()method 
public static function openPopup(URL:String, id:String, param:String = "scrollbars=no,toolbar=no,resizable=no,width=100,height=80,left=0,top=0"):void

Pops up a JavaScript window.

Parameters
URL:String — URL where to pop up a new window.
 
id:String — popup's id
 
param:String (default = "scrollbars=no,toolbar=no,resizable=no,width=100,height=80,left=0,top=0") — Array type of parameters. Optional values for a new window.
setCookie()method 
public static function setCookie(key:String, value:String, expires:Number = -1, path:String = null, domain:String = null, secure:Boolean = false):String

Sets cookie in a browser.

Parameters
key:String — key to specify
 
value:String — value for key
 
expires:Number (default = -1) — cookie expiration time
 
path:String (default = null) — cookie path
 
domain:String (default = null) — cookie domain
 
secure:Boolean (default = false) — cookie security level.

Returns
String
setInnerHTML()method 
public static function setInnerHTML(id:String, HTML:String):void

Specifies innerHTML in a div.

Parameters
id:String — div's ID
 
HTML:String — inner HTML for a div.
setStyle()method 
public static function setStyle(id:String, value:Object):String

Sets style for a DIV.

Parameters
id:String — id of a div
 
value:Object
{width:"500px",height:"300px",background:"#4a4"}
type of value.

Returns
String — Returns the specified style.