How to add spaces HTML output - html

In the below code I want to create spaces when it is executed that is I want to see spaces
"HSC&nbsp" + txthsc.Text + "&nbspHSC" + txthscclg.Text + "
between HSC and txthsc tag so please help..
string strBody = "" +
"" +
"<div>Your name is: <b>" + txtaddress.Text + "</b></div>" +
"<div> your Gender:<b>"+txtgender.Text+"</b></div>"+
"<div> your skills:<b>" + txtskills.Text + "</b></div>" +
"<div> your experience:<b>" + txtexp.Text+ "</b></div>" +
"<div> your phno:<b>" + txtphno.Text + "</b></div>" +
"<table width=\"100%\" style=\"background-color:#cfcfcf;\"><tr><td>1st Cell body data</td><td>2nd cell body data</td></tr></table>" +
"<table width=\"500%\" style=\"background-color:#cfcfcf;\"><tr><td>BBA<b>&nbsp" + txtbba.Text + "&nbsp</td><td>HSC<b>" + txtbbaclg.Text + "</td></tr></table>" +
**"<table width=\"500%\" style=\"background-color:#cfcfcf;\"><tr><td>HSC<b>&nbsp" + txthsc.Text + "&nbsp</td><td>HSC<b>" + txthscclg.Text + "</td>**</tr></table>" +
"<table width=\"500%\" style=\"background-color:#cfcfcf;\"><tr><td>SSC<b>&nbsp" + txtssc.Text + "&nbsp</td><td>HSC<b>" + txtsscclg.Text + "</td></tr></table>" +
"Resume document generated successfully."+
"</body>" +
"</html>";

i think you are missing ; from &nbsp - Correct entity is

Related

how to make each json data to an separate element

** i want to display the theaters like a child node element of the demo node and after i want to trigger the onclick event for other function...**
using only javascript
let VizagData = '{"theater":[' +
'{"TheaterName":"Sangam","Quality":"4K","sound":"DolbyAtmos" },' +
'{"TheaterName":"Sarat","Quality":"4K","sound":"DolbyAtmos" },'+
'{"TheaterName":"Melody","Quality":"4K","sound":"DolbyAtmos"}]}';
let VZMData = '{"theater":[' +
'{"TheaterName":"Srikanya","Quality":"4K","sound":"DolbyAtmos" },' +
'{"TheaterName":"kameswari","Quality":"4K","sound":"DolbyAtmos" },'+
'{"TheaterName":"IMAX","Quality":"4K","sound":"DolbyAtmos"}]}';
function search() {
document.getElementById('th').innerHTML = myfunction();
function myfunction() {
var value = document.getElementById('ct').value;
var th1 = document.createElement('div');
document.getElementById('th').appendChild(th1);
th1.innerHTML = "theaters in " + value;
return th1.innerHTML;
}
}
function data() {
var index = document.getElementById('ct');
var demo = document.getElementById("demo");
if(index.value === "vizag"){
const obj = JSON.parse(VizagData);
demo.innerHTML = obj.theater[0].TheaterName + " : " + obj.theater[0].Quality + "," + obj.theater[0].sound + "<br>" + obj.theater[1].TheaterName + " : " + obj.theater[1].Quality + "," + obj.theater[1].sound + "<br>" + obj.theater[2].TheaterName + " : " + obj.theater[2].Quality + "," + obj.theater[2].sound;
}
else {
const obj = JSON.parse(VZMData);
demo.innerHTML = obj.theater[0].TheaterName + " : " + obj.theater[0].Quality + "," + obj.theater[0].sound + "<br>" + obj.theater[1].TheaterName + " : " + obj.theater[1].Quality + "," + obj.theater[1].sound + "<br>" + obj.theater[2].TheaterName + " : " + obj.theater[2].Quality + "," + obj.theater[2].sound;
}
}
var go = document.getElementById('go');
addEventListener('click', search);
addEventListener('click', data);
<select id="ct">
<option value="vizianagaram">vizianagaram</option>
<option value="vizag">vizag</option>
</select>
<button id="go">GO</button>
<div class="th" id="th"></div>
<div id="demo"></div>

how to retrieve text data in fabricjs?

I wanted to retrieve text data from the fabric text.
I tried with .get('text') but it's telling undefined.
This is my HTML code :
function save(obj){
canvasfabric.forEachObject(function(obj){
// var textname = canvasfabric.setActiveObject().setText(event.target.value);
// alert(textnew);
//var text = canvasfabric.getActiveObject();
// alert(text.get('type'));
//canvasfabric.setActiveObject(textnew);
//var text = obj.get('type');
// var text1 = obj.get('text');
alert("frame : " + i + "\n"
+ "x : " + obj.left + "\n"
+ "y : " + obj.top + "\n"
+ "width : " + obj.width + "\n"
+ "height : " + obj.height + "\n"
+ "class : " + obj.get('text'));
});
//alert("Data has been saved Successfully");
}
Anybody here can help me to retrieve objects text data.

Dojo dijit add Div buttons dynamically

I am having an issue with trying to dynamically create layers that can be be built and removed with a div as a button being added upon the layer's creation. Here's how the code goes:
I am having an issue with trying to dynamically create layers that can be be built and removed with a div as a button being added upon the layer's creation. Here's how the code goes:
//build point graphics layer
graphicsLayerInfo = this._addNewExcelLayerToList(plotArray.length);
graphicsLyr = new GraphicsLayer( { id:graphicsLayerInfo.graphicsLayerID} );
this.map.add(graphicsLyr);
on(dojo.byId(graphicsLayerInfo.removeButtonID), "click" , lang.hitch(this, this._removeExcelLayer, {layerID: graphicsLayerInfo.graphicsLayerID, buttonLayerID: graphicsLayerInfo.currentLayerInfo}) );
...
and the function used to build the DIV/button
_addNewExcelLayerToList: function (pointCount) {
if (this.debugMOde) {
console.info( this.name + ' - ADD NEW EXCEL LAYER called.' );
}
this.layerCount++;
currentLayerID = 'graphicsLayer' + this.layerCount;
graphicsLayerID = this.name + '_gLyr' + this.layerCount;
removeButtonID = "removeGraphicsLayer" + this.layerCount;
this.layerList.push(currentLayerID);
var layerInfo = "Number of Features: 1 Line";
if (pointCount) {
layerInfo = "Number of Features: " + pointCount;
}
content = "<div id ='" + currentLayerID + "'" +
"style='width: 95%;" +
"height: 16px;" +
"line-height: 16px" +
"verticle-align: middle;" +
"padding: 5px;" +
"background-color: #000000;'" +
">" +
"<div style='float:left;'>" +
"<div style="float: left;" +
"width: 20px;" +
"line-height: 20px;" +
">" +
"<img src='./js/Upload/images/excel.png'" +
"style='position: absolute;" +
"top: 0;" +
"bottom: 0;" +
"margin-top: -10px;" +
"width: 20px;" +
"vertical-align: middle;'" +
"></img>" +
"</div>
"<div style='float:left;" +
"font-size: 0.9em;" +
"color: #ffffff;'" +
">" +
"Layer" + this.layerCount + ": " + layerInfo +
"</div>" +
"</div>" +
"<div id='" + removeButtonID + "'" +
"data-dojo-attach-point='" + removeButtonID + "'" +
"name='" + removeButtonID + "'" +
"id='" + removeBUttonID + "'" +
"style='float: right;" +
"width: 13px;" +
"height: 13px;" +
"cursor: pointer;" +
"border-radius: 50%;" +
"border: 2px; solid #ffffff;" +
"background-color: #ff0000;" +
"color: #ffffff;" +
"font-weight: 300;" +
"font-size: 17px;" +
"font-family: Arial, sans-serif;" +
"text-align: center;'" +
">" +
"X" +
"</div>" +
"</div>";
layerListDiv.innerHTML += content;
graphicsLayerInfo = {
removeButtonID: removeButtonID,
graphicsLayerID: graphicsLayerID,
currentLayerID: currentLayerID
}
return graphicsLayerInfo
}
and the function to remove the DIV
_removeExcelLayer: function(layerInfo) {
if (this.debugMode) {
console.info( this.name + " - REMOVE EXCEL LAYER called.");
}
this.map.removeLayer( this.map.getLayer(layerInfo.layerID) );
dojo.destroy(layerInfo.buttonLayerID);
}
It removes the layer if I create only one. If I create more than one, only the last layer created gets moved. All the other 'removeButton's don't work.
Any ideas on how to get this to remove the layers individually, per button?
Well, with the help of a coworker, I got it to work, but not with exactly a separate Event Handler. I used a domConstruct to create it's own area of influence:
domConstruct.create("div", { innerHTML: content }, layerListDiv);
instead of the straight:
layerListDiv.innerHTML += content;
Thank you for your attempts ManjunathaMuniyappa.

how do re-size a HTML <object> tag when the content in it is dynamic

I have some jQuery and HTML that renders an OBJECT tag with a default html page then repopulates the OBJECT on a button click when the new page ,which is dynamic, is done rendering I'd like to resize the object to be 100% the size of the rendered page is that possible ?
code following
$(document).ready(function() {
$('#sq').click(function() {
var actualYear = $('#ay').val() ;
var actualTerm = $('#tc').val();
if (actualTerm == '01')
{
actualYear = Number($('#ay').val()) + 1;
}
var actualTC = actualYear + actualTerm; + $('#smcSel').val() + "&ccc=" + $('#cccSel').val() + "&ac=" + $('#acSel').val() + "&cs=" + $('#csSel').val() + "&cl=" + $('#clSel').val() + "&smd=" + $('#smdSel').val() + "&sm=" + $('#smSel').val() + "&sl=" + $('#slSel').val() + "&ib=" + $('#IBID').val() + "&sb=" + $('#SBID').val() + "&ay=" + $('#ay').val() + "&tc=" + $('#ay').val() + $('#tc').val() + "&tca="+ actualTC + "&mes=" + $('#mes').val() + "&pr=" + $('#pr').val() + "&sr=" + $('#sr').val() + "&tr=" + $('#tr').val() + "&col=" + $('#col').val() + "&mc=";
var urlis = window.location.protocol + "//" + window.location.hostname + "/SASStoredProcess/do?_action=execute,nobanner,newwindow&_program=%2FTABBS%2FuQuery%2Ftbir11052&smc=" + $('#smcSel').val() + "&ccc=" + $('#cccSel').val() + "&ac=" + $('#acSel').val() + "&cs=" + $('#csSel').val() + "&cl=" + $('#clSel').val() + "&smd=" + $('#smdSel').val() + "&sm=" + $('#smSel').val() + "&sl=" + $('#slSel').val() + "&ib=" + $('#IBID').val() + "&sb=" + $('#SBID').val() + "&ay=" + $('#ay').val() + "&tc=" + $('#ay').val() + $('#tc').val() + "&tca="+ actualTC + "&mes=" + $('#mes').val() + "&pr=" + $('#pr').val() + "&sr=" + $('#sr').val() + "&tr=" + $('#tr').val() + "&col=" + $('#col').val() + "&mc=";
document.getElementById("contentarea").setAttribute('data', urlis);
});
});
<div id="result">
<object type="text/html" data="./contentarea.html" style="float:left;width:100%;height:100%;" id=contentarea></object>
</div>
Add this style style="float:left;width:100%;height:100%;" to <div id="result">.
In few browsers, % won't support. So better to specify with pixels (height: 500px; width: 900px;)

Grails JSON from controller to GSP formatting html tag

I am trying to send the following JSON from my controller to the GSP:
[
"message": errorList + '<br/>' + '<br/>' +
'Rows loaded: ' + rows + '<br/>' +
'<img src="${resource(dir: ''images'', file: ''twc-logo-002.png'')}" alt="logo" />'
+ 'Errors: ' + errors + '<br/>' +
'Yellow Issues: ' + yellowFlags + '<br/>' +
'Red Issues: ' + redFlags
]
I am having a hard time with compiler errors on the line containing the image tag. I don't think I am escaping the inner quotes correctly. Any advice? Thanks.
[
"message": errorList + '<br/>' + '<br/>' +
'Rows loaded: ' + rows + '<br/> \'<img src=\"${resource(dir: \'images\',file: \'twc-logo-002.png\')}\" alt=\"logo\" />'
+ 'Errors: ' + errors + '<br/>' +
'Yellow Issues: ' + yellowFlags + '<br/>' +
'Red Issues: ' + redFlags
]