|
You just go:
function the_clown()<br />
{<br />
}<br />
<br />
function bobo()<br />
{<br />
the_clown();<br />
}
Good luck with JavaScript. It is cool writing javascript. I enjoy it alot!
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
Hi all
=-=-=-=
in my HTML I need to open a window.
everything OK....
but then... I was asked to close it
<script language="JavaScript">
function OpenIt()
{
open("http://URL.com","MyNewWindow");
}
function CloseIt()
{
}
</script>
Please Help
=-=-=-=-=-=-=-
The Server
|
|
|
|
|
Hi there this is a bit ironic but anyway thanx for the help and this is what my book says regarding this.
<br />
var popwindow;<br />
<br />
function popup(){<br />
popwindow = window.open("popup.html","","top=40,left=40,width=200,height=100,directories,location,menubar,resizeable,scrollbars,toolbar");<br />
}<br />
<br />
function close_popup(){<br />
if (popwindow !=null )popwindow.close();<br />
}<br />
window.onload = popup;<br />
window.onunload = close_popup;<br />
Hope this helps not sure though!!
Stay well and ejoy life to the max
|
|
|
|
|
I'm a newbie at java script and have made a slideshow which randomizes which pics and so on.
But now I want to display only certain sets of pics inbetween certain times e.g. between 06:00 am and 07:30 am set 1 then back to normal then 11:45 am and 12:50 pm set 2 and so on, and I'm having problems puting all this on a fullscreen with no scrollbars or anything just the pics.
If anyone who reads this can help it would be greatly appreciated.
Stay well and ejoy life to the max
|
|
|
|
|
hi
I dont know how u can check the system time, but...
if u know how then u can do this:
Set an interval using the 'setInterval' function to check the time every
1000 ms (=every second) or 60000 ms (= every minute).
for example
<script language="JavaScript">
var NumberOfPicsForEachSet=5;
var NumberOfSets = 3;
var use_set = 0;
var YourSetsOfPics= new Array(NumberOfSets);
YourSetsOfPics[0] = new Array(NumberOfPicsForEachSet);
YourSetsOfPics[1] = new Array(NumberOfPicsForEachSet);
YourSetsOfPics[2] = new Array(NumberOfPicsForEachSet);
YourSetsOfPics[0][0] = "pic01.gif"
YourSetsOfPics[0][1] = "pic02.gif"
.
.
.
YourSetsOfPics[3][2] = "pic08.gif"
YourSetsOfPics[3][3] = "pic09.gif"
function CheckTime()
{
var the_time;
the_time = YourFunctionToGetTheTime();
use_set= 2;
if ((the_time>"6:00") and (the_time<"7:30"))
use_set = 0;
if ((the_time>"11:45") and (the_time<"12:50"))
use_set = 1;
}
function OnDocLoad()
{
<code> setInterval("CheckTime()",1000);</code>
}
</script>
<body onload="OnDocLoad()">
</body>
Hope I helped you...
I m not sure you can use the [][] like I showed you.
but if u can... good for you (I think it should work.
=-=-=-=-=-=-=
The Server
|
|
|
|
|
Is there any function that would tell me if some date is
correct or not. I have distinct year, month and day variables
and i would like to call some function that would take all these
parameters. If e.g month would be 14 , than function should somehow let me know that the date is not correct.
The same if I enter 34 for day or 31 if february month is set...
, etc.
Thanx for any suggestions
Michal Januszczyk
|
|
|
|
|
PHP has a date function like that, but AFAIK JavaScript doesn't. But it wouldn't be hard to emulate that function.
I'm drinking triples, seeing double and acting single
|
|
|
|
|
Try this date validation script, I found on the net
/**
* DHTML date validation script for dd/mm/yyyy. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;
function isInteger(s){
var i;
for (i = 0; i < s.length; i++){
// Check that current character is number.
var c = s.charAt(i);
if (((c < "0") || (c > "9"))) return false;
}
// All characters are numbers.
return true;
}
function stripCharsInBag(s, bag){
var i;
var returnString = "";
// Search through string's characters one by one.
// If character is not in bag, append to returnString.
for (i = 0; i < s.length; i++){
var c = s.charAt(i);
if (bag.indexOf(c) == -1) returnString += c;
}
return returnString;
}
function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
for (var i = 1; i <= n; i++) {
this[i] = 31
if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
if (i==2) {this[i] = 29}
}
return this
}
function isDate(dtStr){
var daysInMonth = DaysArray(12)
var pos1=dtStr.indexOf(dtCh)
var pos2=dtStr.indexOf(dtCh,pos1+1)
var strDay=dtStr.substring(0,pos1)
var strMonth=dtStr.substring(pos1+1,pos2)
var strYear=dtStr.substring(pos2+1)
strYr=strYear
if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) {
if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)
if (pos1==-1 || pos2==-1){
alert("The Delivery Date format should be : dd/mm/yyyy")
return false
}
if (strMonth.length<1 || month<1 || month>12){
alert("Please enter a valid Delivery Month")
return false
}
if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
alert("Please enter a valid Delivery Day")
return false
}
if (strYear.length != 4 || year==0 || year<minyear ||="" year="">maxYear){
alert("Please enter a valid 4 digit Delivery Year between "+minYear+" and "+maxYear)
return false
}
if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
alert("Please enter a valid Delivery Date")
return false
}
//return true
}
--------------------
Just pass the date from your form to this function
if(isDate(dtePlanDate)==false)
{
return false;
}
==============
Cheers ,
Written on a gravestone:
Here lies a father of 29. He could have had more but he didn't have the time!
|
|
|
|
|
Hello All,
I am needing advice on how to use a map such as mapquest, or another.
Do I do a link to mapquest and post on my clients site?
Or, do they charge a fee for this? I have seen this setup on many sites out there, and was wondering if anyone has experience with this kind of thing.
Thanks In Advance.
Tony
|
|
|
|
|
|
|
It is their restrictions that is a bit rough. You cannot open it in a new window or in a frame so they have to use the back button to return to your site or be gone.
Rocky Moore <><
|
|
|
|
|
Yeah, I saw. I think that's a bit too restrictive.
Tony
|
|
|
|
|
Why is that without setting any filters the mails are sent to junk folder rather than inbox.
This happens at hotmail, indiatimes, etc..
Kindly help and oblige.
Thank you.
Vipul Bhatt
|
|
|
|
|
I believe that the default setting for hotmail is the tightest selection - only accept mail from users in your address book. I have mine set one notch lower, and tonight I had 563 emails in my Inbox, and 64 in my Junk Mail box. All of them are spam. It's probable that most most ISPs use a similar, totally inadequate filter.
"The Lion shall lie down with the Lamb; but the Lamb will not get much sleep..." Lazarus Long
|
|
|
|
|
Roger Wright wrote:
I had 563 emails in my Inbox
How old is your address? Mine is about 4 years old and I don't get that much - maybe 10 a day. Maybe it's to do with the settings - never really looked at them. I only keep my hotmail for MSN Messenger.
Paul
That's better! It looks like radioactive waste now. - Ryan Binns
modified 18-Jul-18 11:59am.
|
|
|
|
|
I'm wanting to put a domain 'search box' on my website so people can see if a domain is available, and if that's the case, buy it. I've looked for scripts that do this, but the only ones I've found are non-free scripts. Are there free scripts available, and if not, how can I program my own?
Thanks in advance
Paul
That's better! It looks like radioactive waste now. - Ryan Binns
modified 18-Jul-18 11:59am.
|
|
|
|
|
|
OK I'll check that one out, thanks.
Paul
That's better! It looks like radioactive waste now. - Ryan Binns
modified 18-Jul-18 11:59am.
|
|
|
|
|
Thanks, but unfortunately that's a COM component, and my host doesn't allow component registering
Any other suggestions? Thanks again anyway
Paul
That's better! It looks like radioactive waste now. - Ryan Binns
modified 18-Jul-18 11:59am.
|
|
|
|
|
|
Interesting - thanks
Paul
That's better! It looks like radioactive waste now. - Ryan Binns
modified 18-Jul-18 11:59am.
|
|
|
|
|
I want to create an array of arrays of strings. Here's what I tried doing:
my (@arrayOfArrays, @array);
This is inside a FOR Loop
{
@array = (@array, "myString");
@arrayOfArrays = (@arrayOfArrays, \@array);
}
That should create an array of array references, where each reference points to an array of increasing size (i.e. one more element than the previous array).
Now, what if I want to add a string value directly to one of the subarrays, say the 5th array (index=4). How would I do it? Is this how?
$arrayOfArrays->[4] = ($arrayOfArrays->[4], "2ndString");
Probably not, because it's not working. Please help with this. Thanks.
|
|
|
|
|
(Assuming that @arrayOfArrays is still in the scope):
<br />
$arrayOfArrays[4] = [ @{$arrayOfArrays[4]}, "2ndString" ];<br />
Basically, @{$arrayOfArrays[4]} dereferences the arrayref, then the [] creates a new arrayref using the contents of @{$arrayOfArrays[4]} and "2ndString" .
- Mike
|
|
|
|
|
Oh yeah, if you want to modify the array directly instead of creating a new array:
<br />
push(@{$arrayOfArrays[4]},"2ndString");<br />
- Mike
|
|
|
|