• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in Java Script

 
Greenhorn
Posts: 16
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know where to ask the question. i try to find some java-script forum but i don't know, how frequent they will respond.
So i am here. i have an good experience in this site, since you gave me quick response before.

Question: in JavaScript
I saw a function with parameter calling function without parameter. If they do so, will it make any problem in big application.

i.e.
function funct1() { alert("Hello"); }
.
.
funct1(100); // can this function able to call above function without parameter and if yes then "Does it make any problem".

I'm working as programmer (Bug fixer). old code they did like that. Client said they got some error, so i need to fix it but no problem in my machine.
I don't know exactly where the bug is, i have a strange feeling that the above code may cause some error.

Sorry if my English is hard to read. Please help me on this issue.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Javascript forum.
 
sureshkumar settu
Greenhorn
Posts: 16
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Christophe Verré : I dont understand, what you are trying to say
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I moved your thread from the JSP forum to the HTML and JavaScript forum.
 
Ranch Hand
Posts: 121
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sureshkumar settu wrote:I don't know where to ask the question. i try to find some java-script forum but i don't know, how frequent they will respond.
So i am here. i have an good experience in this site, since you gave me quick response before.

Question: in JavaScript
I saw a function with parameter calling function without parameter. If they do so, will it make any problem in big application.

i.e.
function funct1() { alert("Hello"); }
.
.
funct1(100); // can this function able to call above function without parameter and if yes then "Does it make any problem".

I'm working as programmer (Bug fixer). old code they did like that. Client said they got some error, so i need to fix it but no problem in my machine.
I don't know exactly where the bug is, i have a strange feeling that the above code may cause some error.

Sorry if my English is hard to read. Please help me on this issue.






It's simple. Javascript doesn't have method overloading kind of thing. You can define two methods of same name and different parameters. Latter one will be always be called regardless of arguments.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The arguments are still there, they are just unnamed




Eric
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sureshkumar settu wrote: but i don't know, how frequent they will respond.


Posting in the wrong forum because you want quicker responses will not work,. In fact, it could work against you because you'll just tick people off, or not reach the actual people who can help you with your question. Please post in the appropriate forum.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing that would throw an error in your code example. I suggest getting the firebug plugin for firefox and debugging from there.
 
reply
    Bookmark Topic Watch Topic
  • New Topic