Jump to content

Passing Parameters & Object Undefined


Recommended Posts

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script>function show(start,end,str){clearTimeout(display);end += 1;document.getElementById("div").innerHTML = str.substring(start,end);if(end < str.length){  var display = setTimeout(show,100);  } else {   clearTimeout(display);   }}window.onload = function(){show(-1,-1,"abcdefghij");}</script></head><body><div id="div"></div></body></html>

I've always had problems with passing parameters in functions.I want to put all the variables as parameters so that I can have a function layout for whenever I need the function and I can put in different values for the same purpose.But FF Console always reports errors like object undefined or simply not working without any error report.In this case, I wonder how I can pass all the parameters.

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...