• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
javascript help needed - please

#1
[eluser]new_igniter[/eluser]
Hello,
I am having problems with something that appeared to be a simple task. Below is my javascript function, in which I am displaying a hidden div, which then has a link to display another hidden div within.
When I go to execute the 'showSomethingElse' function on the onclick, it says postID is not defined. So, how do I pass the postID passed into the showCreate function, so that I can call the showSomethingElse function correctly.

**it keeps removing the code ** Sad

Code:
function showCreate(postID)
{
   document.getElementById("new_container_" + postID).style.display = "block";
   document.getElementById("new_container_" + postJID)[removed] = "<a class="group_link_small" href="#">Create an album</a>";
}
showSomethingElse

#2
[eluser]Randy Casburn[/eluser]
Post the code without the &lt; script &gt; tags, that should allow us to see it.

Randy

#3
[eluser]new_igniter[/eluser]
I actually wasnt posting the script tags, just the function. It removes the innerHTML and the second function call. Perhaps this is the problem? I am trying to write a javascript function call through innerHTML. So I have this function, showCreate, seen above, and I want to write this onclick javascript function to show up in the div through innerHTML.
My problem is that I cant pass the value, passed in through the showCreate function, to the newly created function in the innerHTML

#4
[eluser]Randy Casburn[/eluser]
post it with a space thus: inner HTML - my brain is all twisted up. Must see the code.

#5
[eluser]new_igniter[/eluser]
yes, here is the code with spaces. Sorry for my confusing explanation.

Code:
function showCreate(postJID)
{
    document.getElementById("new_container_" + postJID).style.display = "block";
    document.getElementById("new_container_" + postJID). innerHTML = "<a >Create an album</a>";
}

#6
[eluser]new_igniter[/eluser]
arrggghhh!!!!! ok, let me try once more.

#7
[eluser]Randy Casburn[/eluser]
or attach a zipped up file and I'll look at it that way.

#8
[eluser]new_igniter[/eluser]
Code:
function showCreate(postJID)
{
    document.getElementById("new_container_" + postJID).style.display = "block";
    document.getElementById("new_container_" + postJID). innerHTML = "<a class="group_link_small" click = " showMore ( 'div_loc' + postJID); ">Create an album</a>";
}

#9
[eluser]new_igniter[/eluser]
ok that one is spaced on and the onclick is just click and the showMore function is all spaced out.

#10
[eluser]Randy Casburn[/eluser]
[never mind this post]


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.