|
Senkwe Chanda wrote:
As you can tell, I'm really not much of a web developer at all I'm kind of filling in temporarily so I'm a deer caught in the headlights at the moment.
Thats how it started with me too
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I don't this will work in JavaScript, but it certainly works in Java and might be useful to some people out there (this is obviously part of a class):
import java.util.*;
import java.net.*;
import java.security.*;
private SecureRandom m_secureRandom;
private String m_strIP;
{
m_secureRandom = new SecureRandom();
try
{
m_strIP = InetAddress.getLocalHost().toString();
}
catch (UnknownHostException e)
{
}
}
private String GenerateGUID()
{
try
{
StringBuffer sGUID = new StringBuffer();
StringBuffer sRaw = new StringBuffer();
MessageDigest md5 = MessageDigest.getInstance("MD5");
long time = System.currentTimeMillis();
long rand = m_secureRandom.nextLong();
sRaw.append(m_strIP);
sRaw.append(".");
sRaw.append(Long.toString(time));
sRaw.append(".");
sRaw.append(Long.toString(rand));
md5.update(sRaw.toString().getBytes());
byte[] raw = md5.digest();
for (int i = 0; i < raw.length; i++)
{
int x = raw[i] & 0xff;
if (x < 0x10) sGUID.append('0');
sGUID.append(Integer.toHexString(x));
}
return sGUID.toString().toUpperCase();
}
catch (Exception e)
{
e.printStackTrace();
}
return "";
}
I use the above with great success DUnno how to impl. in JavaSCript, though.
|
|
|
|
|
Thanks alot But it looks like there are a few method calls there that would not be available under javascript. Still, it gives me a few ideas.
Thanks!!
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I've had the same problem. The workaround that I took was to obtain the guid from a seperate page that is loaded on request into a hidden iframe. When that page loads it returns the GUID to the parent page (the page the iframe is contained in). Call GetGUID() to get a guid. When the page is first loaded we get an initial guid by loading the hidden frame which then calls GUIDGenerated when it loads. When we use a new guid the code loads a new guid for use next time by changing the location of the hidden frame.
HOST PAGE:
var LastCreatedGUID;
function GetGUID()
{
var CurrentGUID = LastCreatedUID;
document.frames["fraHidden"].location.replace("GUIDGenerator.asp");
return CurrentGUID;
}
function GUIDGenerated(GUID)
{
LastCreatedGUID = GUID;
}
function GetFirstGUID()
{
document.frames["fraHidden"].location.replace("GUIDGenerator.asp");
}
GUIDGenerator.asp:
<%@ Language=VBScript %>
<%
Dim GUID : GUID = server.createobject("scriptlet.typelib").guid
%>
If you're not using asp use any dynamically created page to get the guid in a similar way.
Hope this helps. Jim
Jim
|
|
|
|
|
When I choose an item from a dropdown combo box and choose the “Print” icon in my web application (cgi and perl), I expect the print preview screen of data corresponding to the chosen item from the dropdown. But I am getting the print preview of data corresponding to a “default” item from the listbox. This problem persists both in IE and Netscape. I reckon this is a cache problem. Please help.
This is Aiyappa Pasura
|
|
|
|
|
I'm developing a web based application using ASP, Perl, and DHTML and am wondering if there is any way to tinker with a clients browser settings. I really just want to force a certain print job to come out in landscape with the "Print background colors and images" set to on. This application is internal so I know that the browsers are going to be IE 5, 5.5, or 6.
Has anyone ever done anything like this.
|
|
|
|
|
Simple answer is; No.
I can't remember where I read it but unless you resort to ActiveX controls Microsoft have specifically blocked any access to the browser application from client side code. I got very annoyed but I suspect it is a good decision of theirs for security reasons.
Seeing as your app will be internal, you could possibly use an ActiveX control to do what you want. Never done it myself though so I cannot help you further than that.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|
|
Remember, though, that:
>you won't always be working with IE
>you won't always be working with Windows
Just ignore this if it doesn't apply to your situation.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
>you won't always be working with IE
>you won't always be working with Windows
Just ignore this if it doesn't apply to your situation
jdunlap, you are preaching to the converted
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|
|
I have a class dll which provides a transparent access to the database, which I have referenced to my web application. The question I wanted to ask was, should I have an instance of the class on every form that uses it, or one instance which is defined in Global.asax which can be used in every form?
Is there any advantages of using one way over the other?
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
I am having trouble implementing wSpell into .asp. Any help would be greatly appreciated. Thank you.
|
|
|
|
|
Hi I'm a university student developing an applicliction in VB that dynamically adds content to a HTML page, the following is an snippit from my code:
Set SelRange = doc.selection.createRange
SelRange.pasteHTML "<span id='EXT_START'><!-- Comment --><b>" & SelHTML & "</b></span>"
SelRange.collapse True
H_HTML = doc.body.innerHTML
WriteHTMLtoFile H_HTML
The problem is that the comment is not added to the HTML ... Why is this? and is there any way to add a Comment? Thanks
|
|
|
|
|
I need to have a small popup appear when the user hovers the mouse over a certain part of an image. I actually need several different popups - one for each region of the image.
Is this possible? Can someone point me in the right direction?
J
"You can get anything you want at Alice's Restaurant."
|
|
|
|
|
It wouldn't be that difficult to have a popup display itself if your regions are square or rectangle. Polygons would require a more advanced algorithm for determining whether the mouse is within the region. However you could probably find C++ code for that algorithm somewhere even on CP maybe and just simply port it to Javascript.
So this would be your first steps:
1) Determine if you image regions required are polygonal or square/rects
2) Search for algorithm for determing whether a point is within an irregular region or polygon or seomthing to that effect.
3) Create your popups dynamically using innerHTML or hardcode them into your HTML.
4) Show and hide your popups using DOM's 'visibility' or 'display'
Have fun.
Cheers!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hi guys, is it possible to send an http post from a client to a server machine using javascript?
For example how can I send a post containing some querystring back to the server from the clients browser?
Thanks!!
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I believe if you want any data sent to a CGI script via POST you must encapsulate your form data with form tags. There is a submit() which could be called to programmatically send data to a script on the server, instead of having the user click Submit button. There may be a hack around this i'm not sure off the top of my head, i'd have to think about it for a while.
If sending data to the server doesn't require POST you can use GET method and send some data to a script on the server whether it be stored in a variable or cookie.
var temp = getCookie('my_cookie', document.cookie);
for(var i=0; i<12; i++){
if(temp==i)
location.href="index.php?my_value="+temp;
}
What exactly is it your trying to accomplish??? Maybe i can figure something out for you.
Cheers!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Well interestingly enough I'm trying to retrieve cookie values and have them sent out to a server as part of a query string. Problem is, I don't know javascript and don't really want to have to learn it. I assumed that there would be similar code snippets out there that I could use but the ones I've seen look hackish. By the way, I want to read the whole cookie, not just specific values.
The method you've shown above though, with "location.href", does that use POST under the covers?
Thanks!
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
Senkwe Chanda wrote:
The method you've shown above though, with "location.href", does that use POST under the covers?
No i'm pretty sure it's GET because the values would be part of the URL.
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
You can use forms , and submit using Javascript.
What you are sending is accessible from server side.
|
|
|
|
|
Hi,
I'm looking for a web site like code project, but for web desing ( CSS's, java script goodies, ...).
Can you tell me one cool site ?
Thanks
|
|
|
|
|
I know a site that isn't as diverse as here but does give some excellent examples of what can be achieved with Javascript and CSS. It's the best web site interface I've ever seen.
www.youngpup.net[^]
Live to ride. Ride to live.
|
|
|
|
|
Anybody knows zipping algorithm in ASP?
or how to write file on server through applet (applet is downloaded from the same host machine , codebase is same host)
I want to create a zip file dynamically using an applet on net and save it on server machine
The flow is like this:
client selects some files from server and pass it to an applet embedded in bowser (Applet is selected coz it is the only way to process on client side )
Applet processes it and make zip out of it and write back to server
But the main problem is applet cant write back to server directly
so I am using applet-javascript-ASP chain
but by this I am not able to use ziping code and just the processed binary data I am able to send to ASP which then create new file for every request and write data in it ; but then I am not able to zip it
Can anybody help me out?
yogini
|
|
|
|
|
I use C# to develop a web embed application, and I find that using WebClient is very easy to raise a web request and get the response. But I don' know how to set the TIMEOUT property(or something like that) to prolong the request time.
|
|
|
|
|
Hi, everyone!
I want to invoke a client side execute program through
a link in the web page. Please notice that it is a client
side program and not a server side one. For example, when clicking
a link pointing to a .rm file on the server, RealOne player on
the cilent side will be invoked.
Are there some sample codes?
Thanks in advance,
George
|
|
|
|
|
You cannot run EXE file, it will break security, but if you mean running a program associated with some file, then just place a link. For RealPlayer, just put a link to your RM file on the server and when user clicks it, the player will pop and start playing (of course if it is installed)
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|