George John has Published 1167 Articles

HTML5 Cross Browser iframe post message - child to parent?

George John

George John

Updated on 24-Jan-2020 11:25:46

144 Views

The parent object provides a reference to the main window from the child.The following is the parent code. The directive below triggers the iFrame to send a message to the parent window every 3 seconds. No initial message from the main window needed!var a= window.addEventListener ? "addEventListener" : "attachEvent";// here ... Read More

Is it possible to use JSF+Facelets with HTML 4/5?

George John

George John

Updated on 24-Jan-2020 10:47:16

111 Views

Facelets is an open-source Web template system for JavaServer Faces (JSF). The language requires valid input XML documents to work. Facelets supports all of the JSF UI components and focuses completely on building the JSF component tree, reflecting the view for a JSF application.Facelets is a XML based view technology. ... Read More

Can you take a screenshot of the page using HTML5 Canvas?

George John

George John

Updated on 24-Jan-2020 10:39:44

392 Views

Html2Canvas is a JavaScript library that can take screenshot of the whole web page or specific part. It doesn’t take the screenshot but creates the view based on the page information.ExampleBelow given is an example code. Here, html2canvas.js script is included at the . The html2canvas() method is called. Returns ... Read More

How to disable browser's back button with JavaScript?

George John

George John

Updated on 24-Jan-2020 10:16:08

3K+ Views

To disable web browsers’ back button, try to run the following code. This is the code for current HTML page, Example           Disable Browser Back Button                               Next Page   ... Read More

Is it required to have a return a value from a JavaScript function?

George John

George John

Updated on 08-Jan-2020 06:30:25

2K+ Views

A JavaScript function can have an optional return statement i.e. it’s optional to return a value. This statement should be the last statement in a function.For example, you can pass two numbers in a function and then you can expect the function to return their multiplication to your calling program.ExampleTry ... Read More

How do I convert a string into an integer in JavaScript?

George John

George John

Updated on 07-Jan-2020 11:02:57

1K+ Views

The parseInt() method in JavaScript converts a string into a number. The method returns NaN if the value entered cannot be converted to a number.ExampleYou can try to run the following code to convert a string into an integer − Live Demo           Check     ... Read More

imagecolortransparent() function in PHP

George John

George John

Updated on 31-Dec-2019 07:58:19

272 Views

The imagecolortransparent() function is used to set the color of a transparent image.Syntaximagecolortransparent ( img, color )Parametersimg: Create image with imagecreatetruecolor() function.color: Color identifier created with imagecolorallocate().ReturnThe imagecolortransparent() function returns the identifier of the new transparent color. The return value is -1 if color is not specified and the image ... Read More

imagecolorsforindex() function in PHP

George John

George John

Updated on 31-Dec-2019 07:46:17

56 Views

The imagecolorsforindex() function gets the colors for an index.Syntaximagecolorsforindex ( img, index )Parametersimg: Creates an image with imagecreatetruecolor()Index: Set the color index.ReturnThe imagecolorsforindex() function returns an associative array with red, green, blue and alpha keys that contain the appropriate values for the specified color index.ExampleThe following is an example Live DemoOutputThe ... Read More

imagecopymergegray() function in PHP

George John

George John

Updated on 31-Dec-2019 07:44:46

30 Views

The imagecopymergegray() function is used to copy and merge part of an image with gray scale.Syntaximagecopymerge ( dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h, pct )Parametersdst_im Set destination image link resource.src_im Set source image link resource.dst_xSet x-coordinate of destination point.dst_y Set y-coordinate of destination point.src_x Set x-coordinate of source point.src_y Set y-coordinate of source ... Read More

imagecolorclosest() function in PHP

George John

George John

Updated on 31-Dec-2019 07:23:04

39 Views

The imagecolorclosest() function gets the index of the closest color to the specified color.Syntaximagecolorallocatealpha (img, red, green, blue)Parametersimg: Image resource created with imagecreatetruecolor().red: Red color componentgreen: Green color componentblue: Blue color componentReturnThe imagecolorclosest() function returns the index of the closest color, in the palette of the image.ExampleThe following is an ... Read More

Advertisements