Results 1 to 4 of 4
  1. #1

    $5 via PP for javascript solution.

    I have a source link set up like this:

    <a href="javascript:function1('$phpVariable');function2('$phpVariable2');function3('image.jpg','imageTitle')">

    This is the target code:

    <a href="javascript:function3('','')" name="linkName"><img src="" name="imageName"></a>

    Functions one and two work just as I need. However, I cannot figure out a way to make function3 in the source link transfer it's data to function3 in the target code onClick.

    Basically, I need a way to access function3('','') in the DOM.

    I will send the money to the first person who replies with a working solution.

  2. #2
    Join Date
    Jun 2006
    Palm Bay, FL, USA
    Why not make a stub function?
    I.e: stub($phpVariable, $phpVariable2, ',')

    Then have the stub call the other functions in sucession.

    Also, you're not being exactly clear on what you're trying to do.

  3. #3
    Join Date
    Aug 2003
    Use a strap function:
    function strap( phpvar1, phpvar2 ) {
    	var return1 = function1(phpvar1);
    	var return2 = function2(phpvar2);
    	function3(return1, return2);
    alternatively, you can have global variables on top of page to handle the results, IE:
    	<script type="text/javascript">
    		var tempVar1 = "";
    		var tempVar2 = "";
    	// -->
    <!-- ... your normal stuff.. -->
    Then, in your function1 and function2, set what you want to the temp, IE:
    function1(variable) {
    	// do something with it
    	// set into the tempVar
    	tempVar1 = variable;
    function2(variable) {
    	// do something with it
    	// set into the tempVar
    	tempVar2 = variable;
    Finally, trigger your function3 with the tempVars:
    function3(tempVar1, tempVar2);
    Good luck.
    Warning: include('signature') [function.include]: failed to open stream: No such file or directory in eval'd code on line 38
    Warning: include() [function.include]: Failed opening 'signature' for inclusion (include_path='.:/usr/local/php5/lib/php') in eval'd code on line 38

  4. #4
    A stub function is not what I need.

    I will try your solutions NE-Andy.

    Thanks to both of you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts