I am trying to escape a string and it currently looks like this:
... onclick="anotherfunction(\'bla\',\'bla\'); myfunctionhere(\'/path1/path2/\'' + val.param1 + '\', \'' + val.param2 + '\', \'' + val.param3 + '\')";
Something is still wrong with it because val.param1 is there but still with an additional ' in front.
Lets say val.param1 is 4711 then the first part of myfunctionhere is being renders as
/path1/path2/'4711
How do I solve this? Removing the second ' does not help.
Ah, got it working right now:
... onclick="anotherfunction(\'bla\',\'bla\'); myfunctionhere(\'\/path1\/path2\/' + val.param1 + '\', \'' + val.param2 + '\', \'' + val.param3 + '\')";
Related
Can someone give me references where I can learn about javascript scripting in BIRT reports?
Scenario is, I have a drop down where which contains name of all car companies... Along with it, it has ALL option.
When "ALL" option is selected it should display all the records of all car brands.
Currently when I select individual car names, it works fine.
ALL option is not working.
Here is a code snippet.
if (params["RP_CarCompany_Name"].value == 'ALL') {
this.queryText = this.queryText.replace('DYNAMIC_CARCOMPANY', "'" + 'BMW' + "'," + "'" + 'AUDI' + "'," + "'" + 'JEEP' + "'," + "'" + 'DATSUN' + "'");
} else {
this.queryText = this.queryText.replace('DYNAMIC_CARCOMPANY', "'" + params["RP_CarCompany_Name"].value.join("','") + "'");
}
P.S.: DYNAMIC_CARCOMPANY is a placeholder in SQL query which is something like this
SELECT * FROM CAR_DB WHERE carcompany IN(DYNAMIC_CARCOMPANY);
Thanks for your help in advance.
I've had this Javascript code on my web site for years and it worked. It is written to help filter out email spam bots;
<script type="text/javascript">
emailserver = "website.com" emailE = "Maria#" + emailserver document.write("<A href=" + "'mailto:" + emailE + "'>" + emailE + "</a>")
</script>
It hasn't worked for a while. Can anyone tell me what changed so that this no longer works? Thanks.
Works fine. You just forgot about semicolons ;.
By the way, you don't need the quotation marks " in the last line of your code (in the document.write() function).
emailserver = "website.com";
emailE = "Maria#" + emailserver;
document.write("" + emailE + "")
I am loading a webview and on dom-ready I execute a function inside the webview like this:
webview.executeJavaScript("$('body').css({'left': '" + left + "', 'top': '" + top + "' })" );
The problem is that webview cannot find reference to $. But I have jquery in my project. What could be the problem ?
Check out this stackoverflow question. You might just need to tell webview that you want to execute JQuery with something like this:
webview.executeJavaScript("jquery:function($('body').css({'left': '" + left + "', 'top': '" + top + "' }))" );
Actually My question is after onclick My Modal is appear and i can insert multiple things into the Modal and i can do this through
(.html("abc");)
But the above syntax is insert only one string if i append multiple String it's shows error
Here is my Code:
echo "<script>
function myFunction(order){
$('.modal-body').html(order.order_id);
$('#myModal').modal({backdrop: false}); /#myModal is the body of the Modal
}
</script>";
Now i find out the soloution we can use this:
$('.modal-body').html('<b>Order Number</b>: '+order.order_id +
'<br>'+'<b>Order Date:</b>' + ' ' +order.created_date+ '<br>'+'<b>Table Number:</b>' + ' ' +order.uid + '<br>'+'<b>Status:</b> ' + ' ' +order.status+ '<br>'+'<b>Title:</b>' + ' ' +order.title + '<br>'+'<b>Quantity:</b>' + ' ' +order.quantity+ '<br>'+'<b>Personalization:</b>' + ' ' +order.personalization);
I am trying to create email templates just using an html file. This file will display a list of mailto links that, when clicked, will open a template with message. I got it working for the most part but some of these templates use prompts to add information to the message before creating it. The problem is that it doesn't seem to work right. Here is my code.
function sendReport(emailName, addresseList){
document.writeln('<a onClick="setPrompt(this,\'' + addresseList + '\')" href="mailto:' + addresseList + '?subject=' + 'Report' + '&body=' + 'Here is the report.' + '">' + emailName + '</a><br />');
}
function setPrompt(obj, addresseList){
var reportName = prompt("Report name","");
obj.attr('href', ='mailto:' + addresseList + '?subject=' + reportName + '&body=' + "Here is the report."); //<-- this is the line that is giving me trouble.
}
You have a typo in the last line and there is no .attr() built in function in Javascript. This should fix it:
obj.setAttribute('href', 'mailto:' + addresseList + '?subject=' + reportName + '&body=' + "Here is the report.");