|
I should think before I talk. The solution was already implemented in the javascript stuff.
Thanks again!
/EnkelIk
|
|
|
|
|
suppose my original text reads:
name: xxx
horoscope: yyyyy
but i want to change it such that my xxx and yyyyy are aligned together.
what code should i write?
|
|
|
|
|
Is this on an HTML page?
theJazzyBrain
Excelence is not an act, but a habbit Aristotle
|
|
|
|
|
Wrap in a table like this:
<table>
<tr>
<td>name:</td>
<td>xxx</td>
</tr>
<tr>
<td>horoscope:</td>
<td>yyyyy</td>
</tr>
</table>
|
|
|
|
|
Hi,
Do you know how to create instance of XML WebService automatically on IIS6.0 ?
When we access XML Webservice after machine running,
The instance of XML WebService is creating.
I'd like to create it automatically after machine runnning.
If you have some solutions( setting IIS or coding ...),
please tell me.
thanx in advance for your kindness.
best regards,
yu-yu,
|
|
|
|
|
Hello.
I've just finished installing an ASP fan fiction system and changed ONLY what the install file told me to do which is change the server settings and Access 2000 etc.
BUT now I have a problem:
Everytime I want to add something, it either doesn't show (like news and author) OR I get this error:
____________________________________________
Microsoft JET Database Engine error '80040e21'
Field 'Categories.CategoryName' cannot be a zero-length string.
/moonbrat/addcats.asp, line 60
_____________________________________________
the thing is, the obj.open only has str or something which is meant to read to the config file...it's very frustrating for me and I'm not sure how to fix it...
I really need help!
-Moonbrat
|
|
|
|
|
Let's have a look at addcats.asp. I'm guessing that you're seeing this after using the AddNew() method, and in the table 'Categories' you have the field 'CategoryName' set with the property that disallows a 0-length string. AddNew() creates a blank record which might be firing this error if your recordset type is Dynaset. Post a bit of your code here for a better look.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Here's the entire Asp code (the rest was to generate the html so I left that out).
________________________________________________________
<title>Add a Category
<% If Request.QueryString("mode") = "doit" Then
If Trim(Request.Form("CategoryName")) = "" Then
Response.Write("
You didn't fill out one or more required fields. Use Back-Button of Browser to correct it or click here! ")
Else Set objConn Server.CreateObject("ADODB.Connection")
Set objRs = Server.CreateObject("ADODB.Recordset")
objConn.Open strConn
objRs.Open "SELECT * FROM Categories", objConn, 3, 3
objRs.AddNew
objRs("CategoryName") = Trim(Request.Form("SubName"))
objRs.Update
objRs.Close
objConn.Close
Set objRs = Nothing
Set objConn = Nothing
Response.Write("
Sub successfully added. Click to continue! ")
End If
End If
%>
____________________________________________________________
Sorry if it looks a mess but it looks better in the edit screen I use for the file as everything is connected.
Anyways, I have the add problem with EVERY script.
I can login but nothing else wants to do anything, like add authors, add news, add categories and add subcategories.
It's annoying me so much!
Thanks for looking at it...I hope you can find the problem where I can't.
At least if it's found in this script I can compare it to the rest of them.
Thanks.
-Moonbrat
|
|
|
|
|
Oh and here's the strConn it's meant to read:
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\1aa\moonbrat\~db\fanfiction.mdb;" 'MS Access 2000 using absolute path
|
|
|
|
|
Moonbrat wrote:
If Trim(Request.Form("CategoryName"))
Moonbrat wrote:
objRs("CategoryName") = Trim(Request.Form("SubName"))
What's going on here? Your script doesn't define or test SubName. Perhaps you should use:
objRs("CategoryName") = Trim(Request.Form("CategoryName"))
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Is there an object in the DOM that accesses the Chache of the browser? I would like to do a bookmarklet (www.bookmarklets.com[^]) to clear the cache with one click and not to walk throgh the Dialogs.
I search this possibility especially for mozilla, as I use it at Home.
Greets
Roland
|
|
|
|
|
Hi all
How to trim a string in javascript (remove spaces at beggining and end of a string)
I need a function like Trim$() in vbScript
thank you.
|
|
|
|
|
According to this handy JavaScript - The Definitive Guide book on my shelf, there is no such function. But it shouldn't be too difficult to write a function for this. Find the length of the string, then search character by character from the beginning and from the end of the string for the first non-space character position. Using two searches, rather than one forward search, allows you to preserve any contained spaces in the target string. Use the two positions as the indices for a call to string.substring(from, to+1) and return the result. Note the to+1 value for the second parameter. The .substring method returns characters up to the position before the the second index for some strange reason.
If you use this in more than a couple of pages in your project, stuff it in a SSI file and include it where you need it. Most of my projects have a util.asp file where miscellaneous workarounds live - someday I may even consolidate them into one generic include.
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
Try this:
<script language="JavaScript" type="text/JavaScript">
<!--
function trim(s) {
while (s.substring(0,1) == ' ') {
s = s.substring(1,s.length);
}
while (s.substring(s.length-1,s.length) == ' ') {
s = s.substring(0,s.length-1);
}
return s;
}
</script>
- Nick Parker My Blog
|
|
|
|
|
thank you all for the responses
I found this code is a site :
function Trim(sString)
{
var sReturnValue = sString.replace(/^\s+/,"").replace(/\s+$/,"");
return sReturnValue;
}
It works fine.
|
|
|
|
|
It's cooler (if you care about such things) to do this:
<br />
String.prototype.trim = function() {<br />
return this.replace(/^\s+/,"").replace(/\s+$/,"");<br />
}<br />
<br />
alert(" foobar ".trim());<br />
|
|
|
|
|
This is cool...
Didnt know that you can do such thing...
theJazzyBrain
Excelence is not an act, but a habbit Aristotle
|
|
|
|
|
I want to make the spacing between text lines bigger:
eg from : this is
my book
to: this is
my book
what is the code to do that?
|
|
|
|
|
Use the line-height CSS attribute. Example:
<div style="line-height: 2em;">
Double-spaced text goes here...
</div>
- Mike
|
|
|
|
|
Am I correct in assuming that it's not possible to read the location.href of another frame in the same browser? Many people have mentioned workarounds to this problem with Netscape Navigator using something like:
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
But I don't see an equivalent for IE. I admitted defeat as I was pressed for time, but if anyone has a good explanation of this, and any potential work arounds I'd appreciate it.
Thanks,
Phil George
http://www.pgeorgeconsulting.com
|
|
|
|
|
I believe as long as each frame has been given a name you should probably be able to manipulate the DOM.
For example I have an IFRAME and inside my IFRAME I reference a element inside the parent document using (if I remember corretly)
window.parent.document.getElementById(test').innerHTML = 'test'
I have this code inside an anchor tag in the IFRAME document and when it's clicked a DIV's innerHTML is replaced. the DIV is in the parent document, not the IFRAME .
So I imagine if I can do this, you can do something like
window.parent.location.href
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
hi
so we're showing a video clip and there is a ranking bar above the video window where people can rate the video ... when they click on the ranking they want to give i fire off a script on the server and return to where i came from, ie, the video page and....
the video starts playing from the start again!! doh!!!
so is there a way i can remember where i am in the stream and then re-seek to that point on return to the page?
"there is no spoon" biz stuff about me
|
|
|
|
|
Twos ways to handle this dilema:
1) Most obvious, would be to have the FORM post to a _blank target, thus not refreshing the web page
2) Embedded media player is an activeX object and so it's possible to use JScript to program the object.
First you need to supply an ID attribute to your object tag
<OBJECT id="myPlayer">
Then it's a simple matter of calling the objects properties or functions.
myPlayer.controls.currentPosition
This property is read/write. So you would read it before submitting (store it in a cookie or pass it along in URL) and start the video again via.
player.controls.play()
HTH
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
there is no form element
i have some javascript onclick handlers that call the reqd script so there isnt a way i know of to direct it to _blank
i have all the labels etc for the player and im cutom controlling the volume etc etc
but reading ur reply gave me an idea im gonna try
thnx
"there is no spoon" biz stuff about me
|
|
|
|
|
Use a JavaScript event which creates and sends an XMLHTTP object to the server. Here's a quick script that should be able to do what you need:
xmlhttp = null;
function onUserClickRating(ratingValue) {
var dom = new ActiveXObject('Microsoft.XMLDOM');
var packet = dom.createElement('YOURDATA');
packet.setAttribute('VALUE', ratingValue);
dom.appendChild(packet);
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
xmlhttp.onreadystatechange = xmlCallback;
xmlhttp.open('POST', 'your_receive_page.asp', true);
xmlhttp.send(dom);
}
function xmlCallback() {
if(xmlhttp.readyState == 4) {
var strResponse = xmlhttp.responseText;
}
}
This *should* work. It's an extremely cut down version of my own XML Communications class I wrote for my CMS. Let me know (if you decide to use it) if it gives you any errors.
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|