Pass an arguments to a function, PHP Web Programming

Assignment Help:

You can pass arguments to a function. These are variables, either strings or numbers, which are utilized inside the function. Certainly the output of the function based on the arguments you give it.

In the following instance we pass two arguments, the number 1 & the string 'house':

example(1,'house');

While these arguments arrive at the function, they are stored up in two variables, a & b. You ought to declare these in the function header, as you can look below.

function example(a,b)

<HTML>

<HEAD>

<TITLE>IGNOU </TITLE>

<SCRIPT Language = "JavaScript">

function example(a, b)

{

var number;

number += a ;

alert('You have chosen: ' + b);

}

</SCRIPT>

</HEAD>

<BODY>

<FORM NAME="selectForm">

<P><B>Click the button below:</B>

<BR>

<P><INPUT TYPE="button" VALUE="Click" onClick="example(1,'house')">

</FORM>

</BODY>

</HTML>

2095_Pass An arguments to a function.png

Figure: Using Functions

This adds one to number and displays "You have decided: house". Certainly, if you call the function like example (5,'palace'), then it adds five to number & displays "You have decided: palace". The output of the function based on the arguments you give it.


Related Discussions:- Pass an arguments to a function

Website paypal integration, Website PayPal integration We have popular o...

Website PayPal integration We have popular of the site developed. We are looking to integrate our website payment system with PayPal. Seeking an experienced developer with PayPa

We need classified ad platform, We need Classified ad platform We need t...

We need Classified ad platform We need to build a free classified ad platform. On that people capable to post for free. Design- Fully compatible with all major browsers Me

I want help in styling live xml feed, Styling Live XML Feed Need the reo...

Styling Live XML Feed Need the reordering as well as styling of a short (dynamic) xml feed. The outcomes are to be showed within an external webpage. Further work is available s

Need help to create amazon affiliat store, Amazon Affiliat Store I need ...

Amazon Affiliat Store I need your services to build me an Amazon Affiliate Webstore (for Health as well as Personal Care Products). Script must import inventory from amazon. Int

Need help in house rental tracking hosted web gui and db, House Rental trac...

House Rental tracking Hosted Web GUI and DB Want a web interface program to track short term rentals of multiple vacation properties. Most information wants to be scraped twice

Create an html document and java applets, For this project, you are requir...

For this project, you are required to design and create an HTML document (also referred to as a "Web page"), in which certain basic HTML elements are incorporated. Your HTML docume

Pre tag, This tag is utilized to present the text precisely as written in t...

This tag is utilized to present the text precisely as written in the code, by including whitespace characters. This is terminated by a tag.  Take the example illustrat

Jquery animations for website help needed, Finish JQuery Animations for Web...

Finish JQuery Animations for Website I am seeking a resources in the US that can work US hours ASAP to finish a couple JQuery animations for our website. The animations are pret

Dreamweaver, A Web site is a set of linked documents along shared attribute...

A Web site is a set of linked documents along shared attributes, such as associated topics, a similar design, or a shared reason. Macromedia Dreamweaver is site creation & manageme

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd