sb.Append("<script language='javascript'>")
sb.Append("window.open('updateRT.aspx?batchno=" + batchno + "&prodcode=" + prodcode + "&maxrunningtime=" + temprunningtime + ",")
sb.Append("top=0, left=0, width=500, height=500, menubar=yes,toolbar=yes,status=1,resizable=yes');")
sb.Append("</script>")
ClientScript.RegisterStartupScript(Me.GetType(), "abc", sb.ToString())
hi everyone ...above is my vb.net code that i am trying to pass the value to other page and at the same time resize the window that will appear ...
i am not sure why and which error that i encounter and the size od windows still remain the same which is full screen rather than with width = 500 and height=500
can anyone help me out here?
thank you so much and have a nice day ...
:D
Whoops, had misread your code.
You're supposed to pass in the window specification as the third parameter to window.open - check out http://www.w3schools.com/jsref/met_win_open.asp. Right now, you're passing everything in one parameter, since the comma which is intended to close the first parameter is actually part of a string. Try
sb.Append("window.open('updateRT.aspx?batchno=" + batchno + "&prodcode=" + prodcode + "&maxrunningtime=" + temprunningtime + "', '_blank',")
sb.Append("'top=0, left=0, width=500, height=500, menubar=yes,toolbar=yes,status=1,resizable=yes');")
Related
I am trying to show the last time I made a published change and the current library version
I created a data element Global - Example:
return "DTM:" + _satellite.publishDate.split(" ")[0] + "|" + "Adobe:" + s.version;
Then I set a prop to my %Global - Example%.
It doesn't work. So I tried to debug in the console. When console.log("DTM:" + _satellite.publishDate.split(" ")[0] + "|" + "Adobe:" + s.version); it works in the console and I get the the last publish date and the current version of the library. However, it won't work for some reason in dtm.
Using a Data Element in this case will have an impact on timing.
If you add your code to the Adobe Analytics Custom Code section of a rule or AA Global Code you should be able to set your prop just fine.
s.prop1 = _satellite.publishDate.split(" ")[0] + "|" + "Adobe:" + s.version);
Hope this helps.
Everything comes just to the following single line of code, which I probably mess up somewhere and after an hour with something of searching for error I still don't find it, so that's why I'm turning up to you.
$("red").append("<div class = "reddot" style = "top: '+ y + 'px; left: '+ x +'px;"><img src='red.png' height='10' width='10'></div>");
When .append(); is without an argument everything with the syntax is good. After I put what you see in, pops up a message "Uncaught SyntaxError: missing ) after argument list" which I can't find. Please help me to find the mysterious bracket or to fix my syntax or to write this in another way if you think this one won't ever work for me. Sorry for this dump question, I searched a lot for this but it was nowhere said about implementing two or more html tags within an append method.
P.S. The idea is to load a container holding an image by generated elsewhere coordinates.
$("red").append("<div class=\"reddot\" style=\"top: "+ y + "px; left: "+ x +"px;\"><img src='red.png' height='10' width='10'></div>");
All the " should be escaped when in a string with " otherwise JS will assume the string has ended
Try this one
$("red").append("<div class = 'reddot' style = 'top: "+ y + "px; left: "+ x +"px;'><img src='red.png' height='10' width='10'></div>");
The jquery below leaves the time from datetime out of the brackets but not the date.
below is the jquery:
$('.counter_area').html('<div class="open-ViewCustomer well well-sm"' +
'data-toggle="modal" data-id=' + v.id +
' data-first=' + v.first_name +
' data-last=' + v.last_name +
' data-time=' + v.joined_at +
' data-note=' + v.note +
' data-download=' + v.attach +
' href="#viewCustomer" data-placement="bottom" title="View Customer Details And Options">' + v.first_name +
' ' + v.last_name +
'</div>'
);
this is what it produces:
<div class="open-ViewCustomer well well-sm" data-toggle="modal" data-id="2" data-first="joe"
data-last="doe" data-time="2014-03-26" 18:22:50="" data-note="null" data-download="null"
href="#viewCustomer" data-placement="bottom" title="View Customer Details And Options">joe doe</div>
as you can see data-time="2014-03-26" 18:22:50="" should be data-time="2014-03-26 18:22:50"
I'm quite new to front end development, any help to solving this is appreciated.
There is a space in your joined date string, so you will need the quotes around the attribute:
' data-time="' + v.joined_at + '"'+
Right now you are stitching a string of HTML together via jQuery, then appending it to your website. This will generally give you the results that you want, but there is a better way to do this:
// select the counter_area div, and append() a new jQuery object
$('.counter_area').append(
// create a new div and make it as a jQuery object
$('<div class="open-ViewCustomer well well-sm"></div>')
// Set each attribute via the jQuery attr() method
.attr("data-toggle", "modal")
.attr("data-id", v.id)
.attr("data-first", v.first_name)
.attr("data-last", v.last_name)
.attr("data-time", v.joined_at)
.attr("data-note", v.note)
.attr("data-download", v.attach)
.attr("href", "#viewCustomer")
.attr("data-placement", "modal")
.attr("title", "View Customer Details And Options")
// set the text of your new div
.text(v.first_name + " " + v.last_name)
);
Why do it this way?
If someone says that their first name is "onload="window.location='http://example.com', then anyone who visits this page will be redirected from the site. This is a security risk known as XSS: people will use it to hack your website.
If you use the code that I have provided, then jQuery will clean up the names for you: the control characters (specifically the quote (")) will be written in such a way that it is made safe.
jQuery will also automatically handle spaces, quotes, and any other weird characters that might appear in the date or name, so you'll have one less thing to worry about.
Try to add quotes around your values (after the equals and after the concatenated value).
Without them, a space in your values will be interpreted as the end of your value and the begin of a new attribute.
I checked a lot on Hrefs but couldn't get something related.
I am trying to do this in code behind which is actually a custom control class
writer.Write("<a href='javascript:document.location.href?" + filter.ParameterName + "=" + filter.QueryValue + "'>" + filter.UserVisibleValue + "</a>| ");
now this gets me something like this on hover of above anchor 'document.location.href?Test one=2013' and when i click it, this throws an obvious javascript error 'SyntaxError: missing : in conditional expression' because it takes it as a conditional operator and hence finds : missing.
I simply want that document.location.href (current url) should be calculated and the value put in where i use it.
I know that i may simply call a javascript function and inside that function i set the href but can i do it this way?
Try this:
writer.Write("<a href='javascript:window.location = document.location.href?" + filter.ParameterName + "=" + filter.QueryValue + "'>" + filter.UserVisibleValue + "</a>| ");
Note that you might have to escape values as needed otherwise JavaScript will become invalid. To prove that above approach works, you can copy-paste following simpler example in any HTML page and see it working:
bla
window.location="http://test.rgniyd.com/test1/?q=node/36/"&dept="+ dept +"&bath="+
bat +"&month=+month+"&year="+year+"&semester="+sem";
how to redirect the page to http://test.rgniyd.com/test1/?q=node/36/ with values in
JavaScript. the above code is not working , please help or please suggest me how to redirect page without clearing the session values in JavaScript
Change your JavaScript as
window.location="http://test.rgniyd.com/test1/?q=node/36/&dept=" + dept + "&bath=" + bat + "&month=" + month + "&year=" + year + "&semester=" + sem;
Because you have misplaced double quotes "
You have messed up (a bit) the string concatenation..
window.location="http://test.rgniyd.com/test1/?q=node/36/&dept="+ dept +"&bath="+
bat +"&month="+month+"&year="+year+"&semester="+sem;