|
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]
|
|
|
|
|
hello all,
My page was built using 's from CSS. Now I want the whole page to be centered but I am not able to do it.
In my CSS file I have entered:
body{
text-align:center}
but nothing goes on.
Can anyone help me out here please.
Regards,
Tiruvan
|
|
|
|
|
One way of doing it is to put all your content into one DIV tag. Then you need to align the outer DIV as such:
<br />
DIV.master {position:absolute; width:600px; left:50%; left-margin:-300px;}
Notice that the left-margin must be minus half of the width in order to align it in the center.
This also works for horizontal aligning.
Ofcourse, if you have used ABSOLUTE positioning for your content you will have to change it to RELATIVE in order to use as origin the top left coords of the master div instead of the top left coords of the BODY.
Hope that I helped.
theJazzyBrain
Excelence is not an act, but a habbit Aristotle
|
|
|
|
|
try something like this on a containing DIV (or whatever elements suits the need):
#container {
position: relative;
width: 800px;
margin-left: auto;
margin-right: auto;
text-align: left;
border: 0px;
}
Wally Atkins Newport News, VA, USA
|
|
|
|
|
I need to dynamically (usign javascript) open a new window and start a new session on that window while keeping the previous session on the opener window.
Is this possible?
Is there a trick or anything that I can do?
Is this possible in PHP maybe?
Thanks!
theJazzyBrain
Excelence is not an act, but a habbit Aristotle
|
|
|
|
|
php is a server-side scripting environment so u cant do any window popping stuff in it
what do u want to open the new window in response to?
"there is no spoon" biz stuff about me
|
|
|
|
|
I know that PHP is a server side srcipting language. So is ASP. I know how to open a new window using Javascript on the client. The problem is that I want along with the new browser window to start a new session on the server while keeping the session in the opener window active.
I know that when a new window opens (programmatically), the new window belongs to the same session as the opener. I dont want to do that. If on the other hand abandon the session then, I lose the session from the opener window too.
theJazzyBrain
Excelence is not an act, but a habbit Aristotle
|
|
|
|
|
It maybe impossible.
I donn't know your true puspose.Saying your final requirement.
Thinking-Asking-Thinking
|
|
|
|
|
Hi,
My question concern ASP.net / HTML even DHTML (?).
I use a asp:DropdownList (databinded to a collection of objects) and set the width to a limited value. The long text is then cut. I'd like to find a way to display, in a popup for example, the entire content of the selected item.
I don't find any proper property concerning this point. Perhaps styles ? or programming DHTML ? Any other solution ?
Thanks,
Laurent.
|
|
|
|
|
There is no event (as far as I am aware) that is fired when you hover over an item while the fly-out box is present. An event fires when you select a new item, and during different parts of your click, etc. If you want the item to become visible when you hover over it in the list, you're probably out of luck. If you want to show the full item name once it is selected, that would be pretty easy, you'd just have to use the "onmouseover" event to show a hidden, absolutely-positioned div, which you'd dynamically fill with the content of the currently selected item.
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|