1

I want to insert the value after ^ into javascript:DoRowAny(here)

var totalApps = 0^NOT_DECIDED~P~TUYTR78YT; //dynamically generated
var totalNumber = totalApps.split('^')[0];
var totalId = totalApps.split('^')[1];

var totalapp = '<a class="app" data-placement="top" data-original-title="' + totalNumber + ' in total."href="javascript:DoRowAny();" >' + totalNumber + ' not decided.</a>' ;

javascript:DoRowAny(totalId) // I thought this would work but it does not. Pure javascript not jquery.

<a class="tooltip-item action-reqd" data-placement="top" data-original-title="View 0 applications<br>requiring pre-decision action." target="_parent" href='javascript:DoRowAny("YES_DECIDED~YD~TPPEUR98UYD01");'>0</a>


function DoRowAny(id) // 
     {  
            document.getElementById('#inputOne').value=id;  //inserts the value of the id into the input
            document.getElementById('#buttonThree').click(); //and then clicks button 3
            return true;
            };
4
  • Did you mean for that to be a string? var totalApps = "0^NOT_DECIDED~P~TUYTR78YT"; Commented Sep 18, 2014 at 12:32
  • Did you open the console? If it's written like in the question, that's a syntax error. Commented Sep 18, 2014 at 12:32
  • It should be like this javascript:DoRowAny("YES_DECIDED~YD~TPP06HYT1"); when you roll over the mouse in the anchor Commented Sep 18, 2014 at 12:36
  • Add your html too & what is DoRowAny() method?? Commented Sep 18, 2014 at 12:39

1 Answer 1

1

Try this -

Use escaped '

var totalapp = '<a class="app" data-placement="top" data-original-title="' + totalNumber + ' in total." href="javascript:DoRowAny(\''+totalId+'\');" >' + totalNumber + ' not decided.</a>';

DEMO

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks but what I want is javascript:DoRowAny("YES_DECIDED~YD~TPP06HYT1"); instead of javascript:DoRowAny(''+totalId );

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.