0
var img = '<textarea cols="60" id=' + div_id + ' name=handle[' + required_name + '] rows="7">';
img = img + '<div id="fullscreen-button-'+id+'" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen('+'"'+path+'"'+')"></div>';
img = img + '<embed src=' + path + ' width="" height="" />';
img = img + '</textarea>';

============================================

Output coming is

<div id="fullscreen-button-0" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen(" upload microsite micro_1 calcsmall.swf')'></div>

onclick="fullscreen(" upload microsite micro_1 calcsmall.swf')'

I want

onclick="fullscreen('upload/microsite/micro_1/calcsmall.swf')"

6
  • can you paste what does path variable contain anyway perhap then we can help Commented Oct 22, 2012 at 11:23
  • path = upload/microsite/micro_1/calcsmall.swf Commented Oct 22, 2012 at 11:42
  • actually I'm using all this in javascript code. No use of rails. Commented Oct 22, 2012 at 11:48
  • @manish_nautiyal why not render like this %Q{<div id="fullscreen-button-'#{id}'" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen('#{path}')"></div>} Commented Oct 22, 2012 at 11:53
  • @Viren when I click on a image I change the value of text-area and then save it on table. And on another page I display it. I'm using handle_bar for this. So I have to use javascript. Commented Oct 22, 2012 at 11:55

1 Answer 1

1
img = img + '<div id="fullscreen-button-'+id+'" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen(\''+path+'\')"></div>';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.