CodeIgniter Forums
javascript help needed - please - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: javascript help needed - please (/showthread.php?tid=10971)

Pages: 1 2


javascript help needed - please - El Forum - 08-20-2008

[eluser]Randy Casburn[/eluser]
ok, I see, you anchor tag needs to be adjusted:

Code:
"<a href="java/script : void/(0);" class="group_link_small"click = " show/More/('div_loc'+post_ID); ">Create an album</a>";

corrected a couple things. This should do better for you. Please remove the slashes.



Randy


javascript help needed - please - El Forum - 08-20-2008

[eluser]new_igniter[/eluser]
yeah, I could put the function there, but how would I write the function call through the inner HTML?


javascript help needed - please - El Forum - 08-20-2008

[eluser]Randy Casburn[/eluser]
OK...check my previous post.


javascript help needed - please - El Forum - 08-20-2008

[eluser]new_igniter[/eluser]
ok, I will try. Thanks so much for your patience/help Randy.


javascript help needed - please - El Forum - 08-20-2008

[eluser]new_igniter[/eluser]
it calls the function fine. I guess I am having problems with getting the value passed through the first function into the second function. Do you know the method of doing this? It always the variable is undefined.


javascript help needed - please - El Forum - 08-20-2008

[eluser]new_igniter[/eluser]
please see this file. I cant get the value from the original function. when it tries to do the alert, it just says 'postJID is undefined' in the error log.


javascript help needed - please - El Forum - 08-20-2008

[eluser]Randy Casburn[/eluser]
Yes -- I'm certain you have to concatenate the variable rather than put it into the string. I should have caught this the first time...

rather than this...

onclick=\"alert(postJID);\"

it should be

onclick=\"alert("+postJID+");\"

Randy


javascript help needed - please - El Forum - 08-20-2008

[eluser]new_igniter[/eluser]
works great. I almost embarrased to ask this next question. How can I append some text? do that when I do the alert it would say "div_container_2002912", for example, with the 2002912 being postJID

Thanks so much!


javascript help needed - please - El Forum - 08-20-2008

[eluser]Randy Casburn[/eluser]
onclick=\"alert("+'My text that I want to show up in the alert box goes here! '+postJID+");\"


javascript help needed - please - El Forum - 08-20-2008

[eluser]new_igniter[/eluser]
Thanks so much Randy!!