Jump to content

Undefined variable


Mortier

Recommended Posts

Hello all, I have an very odd error in my code:

 

function open_one(all_element, one_element, event_div)
{
alert(event_div)
}

 

<body onload="load_config(document.getElementById('all_items'), document.getElementById('one_item'), 'collapse'); return false">
<img id="collapse" src="img/img_left.png" onclick="open_one(document.getElementById('all_items'), document.getElementById('one_item'), 'collapse'); return false" alt="Uitklappen" />
<div id="all_items">Alle items</div>
<div id="one_item">Één item</div>
</body>

 

The problem is that the alert (which I use for debugging) returns 'undefined'. While I give it the value 'collapse' in the function call.

I tried everything but I don't know why it does not work.

Tested in Firefox.

 

 

Link to comment
https://forums.phpfreaks.com/topic/55555-undefined-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.