|
Just put your JavaScript code into a file named script.js (or something similar), and include it in your headers, e.g.:
<html>
<head>
<script language="javascript" type="text/javascript"
src="script.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<-- Rest of page... -->
- Mike
|
|
|
|
|
Does anyone know of a method by which I can assign a specific file as content for an iframe? What I have in mind is a "thought for the day" based on a hard-copy diary of quotes. I have been able to do this inside VBScript, but not to transfer it to my html page.
|
|
|
|
|
Try this JavaScript:
<br />
iframeName.src = "yourUrl.htm"<br />
But I think that it would be better to have all you quotes in a database and randomly select one when the iframe is loaded...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Thanks for the advice so far.
However, I think I must put a scenario to all you good people:
Say I have a site on the subject of world history (not true, but near enough - very similar) and I want an "events of the day", including births, deaths, battles, coronations, .... Average daily insert +- 200 words. I have a file containing six months at a time: 744k., from which this has in the past been done (don't ask me how, but I have seen it - seems easy enough too).
My second aspect is that while I'm running through the year, I'll be translating into a second language and putting both on one page on my site (for the simple reason I'd like prospective translation clients to compare the quality of my work).
I can compile a variable by way of a string in the VB environ, but how to transfer that as VBS to my HTML page? (And I need to put the site up asap!)
|
|
|
|
|
How can I force a browser to use a particular character encoding set?
I have made all the meta tags in my HTML files specify utf-8 for the charset property but I still seem to open them as western 1?
Andy
|
|
|
|
|
Hello !
I have some experience with com/webbrowser/mshtml. Recently I run into a very interesting problem, and after spending some days on it(no success) I decided to try geting some answers from other programmers.
So: I wrote a simple browser helper object. On a machine without internet access, when detecting BeforeNavigate2 event, I redirect navigation. For example, if the user enters http://www.google.com, i redirect to http://mygateway/page.aspx?url="http://www.google.com".
This works fine, the problem is I can't redirect the location of the objects in the document (objects; images; flash; etc), and the page can not load them.
I couldn't find an event that fires when a resource download begins, and a mechanism for redirecting these downloads. (please note that implementing a download manager dows not solve this problem; dm objects are invoked only when the user explicitly selects "download targer..." from the context menu for example).
Please let me know if you have any ideas ( is it possible ? is it not ? a source for more info -> i've already read all I could find in msdn and microsoft on this topic and got no answer ).
I don't need specific code / code samples, I only need a hint on how to do it. I'm not interested in parsing the html code and modifying the links. pages may contain flash/applets, and i can't parse them to change the links. I need browser redirection.
As soon as I'll solve this problem, I'll post the project (no mfc; no atl; just pure C++/Com).
All the best,
psangeljg
ps. I did find a solution, but it's not what I want. I figured that mshtml uses wininet (wininet.dll) to access the resources. I could write my own wininet.dll that calls the actual wininet.dll, changing the urls. However, I try to avoid this soultion, since wininet.dll varies with the os version. Performance is also important.
|
|
|
|
|
I know how to align an HTML background image to one side or another (using background-position), but how can I make it start at 0,0 and stretch to exactly fit the size of the element?
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I'm not sure what you mean, but try something like this
CSS:
tr.title<br />
{<br />
background-image: url(\Images\bar.gif);<br />
}
in HTML:
<tr class=title>
|
|
|
|
|
You can use that to tile an image or to have the image shown once on the background, but I haven't found a way to stretch it to exactly fit the element.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Is there a way to load an html page using DHTML. I have lots of HTML source already written, and I'd like to have a page with the following
<html>
etc etc...
<body>
<div id="menu">menu content here</div>
<div>load a previously written html document here</div>
</body>
</html>
Is this possible?
andy
|
|
|
|
|
you can useful DOM method inside JavaScript:
----------------------------
document.write(place your html code here);
|
|
|
|
|
can I do something like
document.write(../../xxxx.html)
?
|
|
|
|
|
Hi,
I would be really grateful for som info on this.
(1) How do I perform a javascript submit from a C++ client app. My own guess is that using CInternetFile::Write() would be a good start but I wonder whether this is enough or if perhaps special string formatting or additional data needs to be added to the written string.
(2) To do a HTML POST could probably be done in a similar way but how do the the "name= " and "action= " parameters fit into the picture?
(3) Are there classes in .NET that would do this whole thing a lot easier?
thanks and cheers
Adam
_____________________________________
Action without thought is not action
Action without emotion is not life
|
|
|
|
|
I have not idea about C++ but I can tell you that you need to do an HTTP POST not and HTML POST...
Have a look at the HTTP protocol. Also, I dont know if this is helpfl but you could use the Browser Control to make a browser within your C++ app.
The two most popular methods for sending data to the server through HTTP are the POST and the GET methods.
When you use the POST method, the extra data is passed along in the queristring. This is the string after the ? sign on long URLS...
On Get methods the data is passed within the body of the HTTP message...
It could be the other way round with POST and GET, I am not very sure... but I hope I gave some idea..
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Hi all,
I know little about HTML and the like so I really need your help.
I have a bunch of bmp files named file1.bmp, file2.bmp etc
Is there any way I can show them in a HTML file so they would appear like an animated gif?
Basically show file1.bmp, wait a bit, show file2.bmp on top of file1.bmp etc...
Can this be done, 3rd party freeware tool would be fine, or do I have to build my own ocx control?
Thanks.
.Henrik
---
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
I believe that you can use the AdRotator object in ASP for this. It just takes a little bit of VBScript added to your HTML page...
"Welcome to Arizona! Drive Nice - We're Armed..." - Proposed Sign at CA/AZ Border
|
|
|
|
|
I would do a small JavaScript function to handle this...
I would initially load the first 2-3 pics and then for each one that I show I would start donwloading another one in order for the slide show to be fast...
Try using the setTimeout, setInterval functions in JavaScript... This will help you handle the timing...
Try using an aray or an object to store the Images that you download...
keep a numbered naming on your images so you will know which one is to be downloaded next...
The good thing about this is that you could potentially use transistions between your images...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Hi
I am trying to load a texture from an image I get from a Web Service. D3D provides a method TextureLoader.FromStream using which you can load a texture from a stream. This is the code I wrote to load the texture:
imageRequest = (HttpWebRequest)WebRequest.Create(URL);
URL is something like http://terraservice.net/ogcmap.ashx?version=1.1.1&request=getmap&layers=drg&styles=utmgrid_yellow&srs=epsg:4326&bbox=-122.427,36.66,-117.756,38.947913&width=1000&height=500&format=image/jpeg
imageResponse = (HttpWebResponse)imageRequest.GetResponse();
imageStream = imageResponse.GetResponseStream(); // get a "Stream" from the "Response" object
TextureLoader.FromStream(device, imageStream);
But TextureLoader.FromStream() fn. Gives an error message that “stream does not allow seeking”
Then this is the second thing I tried:
imageRequest = (HttpWebRequest)WebRequest.Create(URL);
imageResponse = (HttpWebResponse)imageRequest.GetResponse();
imageStream = imageResponse.GetResponseStream(); // get a "Stream" from the "Response" object
byte[] buffer = new byte[imageResponse.ContentLength];
imageStream.Read(buffer, 0, (int) imageResponse.ContentLength);
// imageResponse.ContentLength is long so have to cast to int
MemoryStream stream = new MemoryStream(buffer);
texture = TextureLoader.FromStream(device, stream);
but imageResponse.ContentLength is always equal to -1. I was able to save the image by doing:
Image img = Image.FromStream(imageStream);
img.Save("c:/junk/texmap.jpg", ImageFormat.Jpeg);
and it came out fine when i opened it in photoshop.
Then I tried following code (replaced imageResponse.ContentLength by imageStream.Length):
imageRequest = (HttpWebRequest)WebRequest.Create(URL);
imageResponse = (HttpWebResponse)imageRequest.GetResponse();
imageStream = imageResponse.GetResponseStream(); // get a "Stream" from the "Response" object
byte[] buffer = new byte[imageStream.Length];
imageStream.Read(buffer, 0, (int) imageStream.Length);
MemoryStream stream = new MemoryStream(buffer);
texture = TextureLoader.FromStream(device, stream);
but this gives following error while trying to access imageStream.Length while executing
byte[] buffer = new byte[imageStream.Length];
exception of type 'System.NotSupportedException' occurred in system.dll
This stream does not support seek operations.
Any ideas what to do?
sid
|
|
|
|
|
Hi,
I am developing a website.
1. How can I send the message out there about my site?
2. How can my site be searchable in Search Engines?
3. Any other helpful information for site promotion.
Please advise. Thanks
Pankaj
~~~~Pankaj~~~~
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
mittalpa wrote:
1. How can I send the message out there about my site?
There are several newsgroup that allow announcements of sites and products. Do not remember them at the moment. You might also check into sites that handle press releases, there are several.
mittalpa wrote:
2. How can my site be searchable in Search Engines
Go to the search engines and submit them. There are also sites and products that will do this for you. Personally, there are only a handfull of search engines that get much use so it is pretty easy to do by hand.
2 tips.. 1) search the net for Meta Tags and Robot.txt information. You should use both for your site to help search engines search your site. Meta tags can help keyword listings and site descriptions.
mittalpa wrote:
3. Any other helpful information for site promotion.
A good place to start on a buget is "affiliate programs". Search Google for that and you will find a ton. You can create an affiliate program or sub that out to another company such as DirectLeads.com or LinkShare.com. This can drive traffic to your site based on commisions for products sold or on a per click basis.
Another thing to check into is keyword advertising on Google. Easy to setup and can drive traffic to your site without a lot of cost if your keywords are specific enough.
Rocky Moore <><
|
|
|
|
|
Suggested improvement to:
a script that autimatically enters a the specified character at a certain point in a text box
By webProgrammer
Posted: 12 Aug 2003
This script could be improved with the addition of a line to detect and permit the use of the backspace key:
function mask(str,textbox,loc,delim){
var locs = loc.split(',');
for (var i = 0; i <= locs.length; i++){
for (var k = 0; k <= str.length; k++){
if (k == locs[i]){
if (str.substring(k, k+1) != delim){
if (event.keyCode != 8) //backspace
str = str.substring(0,k) + delim + str.substring(k,str.length);
}
}
}
}
textbox.value = str
}
|
|
|
|
|
thanks for the addition, I was about to add that myself, when I noticed your addition/fix.
|
|
|
|
|
Hi. I'm not sure this is the right message board for this question, but here goes:
I have a C# client that consumes web services that are written in java developped on Axis. I've had no problems with this until now when they introduced a web service that returns a file as an attachement using datatype javax.activation.DataHandler. According to the 'deliverer' of the service I have to write the stubs my self but should appart from that not have any problems using the service.
I have not yet figured out how to write the stub for the method returning a DataHandler object and I read somewhere that it is impossible to use a web service returning this datatype in a C# client. Then again somebody else said that if the 'deliverer' of the service implement a web service that reads the file and transmits it as byte[] that would be ok.
Can anyone tell me what is really the case? It would of course be most conveniant for me if I can write a consumer of the original service but if I need to get them to develop the extra byte[]-wrapper service then so be it. I guess it would be possible to write a component in java that the C# client uses for the calls to the web service, but my knowledge of java is rather small.
Thanks
/EnkelIk
|
|
|
|
|
Hi.
I found a component to make a .NET wrapper for the .jar defining the DataHandler class, so it feels like I have advanced one little step. So I include the wrapper dll and try to use DataHandler just like any object and the code compiles without warnings but I can't run it because as it turns out the DataHandler has no public default constructor. The error telling me that amy method cant be reflected.
Logically serializing works the same in both .net and on a java-plattform, and I have a sample code how to do this in java.
The java code looks like this:
java.lang.Class jafsf = org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.class;
java.lang.Class jafdf = org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory.class;
qName = new javax.xml.namespace.QName("http://activation.javax", "DataHandler");
cachedSerQNames.add(qName);
cls = javax.activation.DataHandler.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(jafsf);
cachedDeserFactories.add(jafdf);
so obviuosly there are 'custom' serializers for the DataHandler object. Now how can I use these in .NET?
My code currently looks like this:
<system.diagnostics.debuggerstepthroughattribute(), _
="" system.componentmodel.designercategoryattribute("code"),="" system.web.services.webservicebindingattribute(name:="SecureCertificateFetcherSoapBinding" ,="" [namespace]:="http://some.where.tm/axis/services/SecureServiceFetcher" ),="" system.xml.serialization.soapincludeattribute(gettype(datahandler)),="" system.xml.serialization.soapincludeattribute(gettype(errorobject))=""> _
Public Class SecureServiceFacadeClientService
Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
'<remarks>
Public Sub New()
MyBase.New()
Dim urlSetting As String = System.Configuration.ConfigurationSettings.AppSettings("MYDAC.MyService.SecureServiceFacadeClientService")
If (Not (urlSetting) Is Nothing) Then
Me.Url = String.Concat(urlSetting, "")
Else
Me.Url = "http://some.where.tm/axis/services/SecureServiceFetcher"
End If
End Sub
'<remarks>
<system.web.services.protocols.soaprpcmethodattribute("", requestnamespace:="http://some.where.tm/axis/services/SecureServiceFetcher" ,="" responsenamespace:="http://some.where.tm/axis/services/SecureServiceFetcher" )=""> _
Public Function getService(ByVal in0 As UserVO, ByVal in1 As SecureServiceVO) As <system.xml.serialization.soapelementattribute("getservicereturn")> SecureServiceVO
Dim results() As Object = Me.Invoke("getService", New Object() {in0, in1})
Return CType(results(0), SecureServiceVO)
End Function
'<remarks>
Public Function BegingetService(ByVal in0 As UserVO, ByVal in1 As SecureServiceVO, ByVal callback As System.AsyncCallback, ByVal asyncState As Object) As System.IAsyncResult
Return Me.BeginInvoke("getService", New Object() {in0, in1}, callback, asyncState)
End Function
'<remarks>
Public Function EndgetService(ByVal asyncResult As System.IAsyncResult) As SecureServiceVO
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0), SecureServiceVO)
End Function
End Class
where the class SecureServiceVO contains the DataHandler and ErrorObject (which has a public default constructor).
My quess would be that I need to replace the
System.Xml.Serialization.SoapIncludeAttribute(GetType(DataHandler)), _
line with something pointing at the org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.class;
How do I do this? And how do I specify that this is the serializer and there is another factory for the deserializer?
Please help!
/EnkelIk
|
|
|
|
|
Hello there,
I used ASP.NET to develop some web applications. I want to design a web page now, but not sure how to get it done, what's the procedures? Can anybody advise me where I can find the tutorials for web page design and how to get it published, etc? Thanks!
|
|
|
|
|