|
i want to implement a loader to website.
when any user open the website, loader is visible till that time till when whole page is not loaded included image.
this loader will be in js not in jquery.
Regds
Vishal Bansal
|
|
|
|
|
Hi Vishal,
Here's a nice example:
preload_wait.html[^]
It has sample JS code also
Good luck
Cheees,
Edo
|
|
|
|
|
Hi Edo,
Tx alot.
Regds
Vishal Bansal
|
|
|
|
|
div#page_loader {
position: absolute;
top: 0;
bottom: 0%;
left: 0;
right: 0%;
background-color: white;
z-index: 99;
}
<script language="javascript" type="text/javascript">
<a onclick="javascript:document.getElementById('page_loader').style.display='block';" href="webpage.html">Web Page</a>
</script>
|
|
|
|
|
I'm having trouble with Canadians checking out with with my shopping cart, seems because I use US Zip Codes, I don't have the experience needed to use Canadian Postal Codes.
I thought Canadian postal codes were just 6 straight values XXXXXX, and I suspect that many Canadians split the 6 values into pairs of 3 XXX XXX, or perhaps something else.
I'm not really sure why I'm having trouble with them.
Anyways, rather than reinventing the wheel here on this one, thought I would see if there any Canadian Programmers out there using something better than what I'm using
var re_Billing_PostalCode_CA = new RegExp("^[ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9]$")
|
|
|
|
|
A quick google for 'canada postal code regex' found this[^]
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I found this, looks like it allows for the space XXX XXX or XXXXXX
and tested it using L4A 0S1 and L4A0S1, but for some reason I always get bit in the rear for not using more test samples.
var re_Billing_PostalCode_CA = new RegExp(/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]( )?\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i);
|
|
|
|
|
It's been awhile since I've worked with JSON, I created and element with child elements called result_Error,
and I can't remember how to parse the child elements within. I did validate the JSON below to be correct
So like result_WarningMessage and result_Error is what I want to parse.
{
"result_StatusCode": 1,
"result_StatusMessage": "Success",
"result_WarningMessage": [
{
"Message": "Ship To Address Classification is changed from Residential to Commercial"
}
],
"result_API_Code": "12",
"result_API_Name": "UPS Three-Day Select®",
"result_Billing_SurCharge_Value": "$0.00",
"result_Billing_SurCharge_Currency": "USD",
"result_Billing_NetCharge_Value": "$8.29",
"result_Billing_NetCharge_Currency": "USD",
"result_Billing_Weight_Value": "01",
"result_Billing_Weight_UnitType": "LBS",
"result_ShipDate": "",
"result_DayOfWeek": "",
"result_DeliveryDate": "",
"result_Error": [
{
"ErrorSeverity": "Hard",
"ErrorCode": "111211",
"ErrorDescription": "The requested accessory option is unavailable between the selected locations."
}
]
}
|
|
|
|
|
If you have it as a string, then parsed = JSON.parse(yourString) will convert it to an Object.
Then you can access the parts you want as parsed.result_WarningMessage and parsed.result_Error , both of which are arrays of Objects:
var message = parsed.result_WarningMessage[0].Message;
var severity = parsed.result_Error[0].ErrorSeverity;
var code = parsed.result_Error[0].ErrorCode;
var description = parsed.result_Error[0].ErrorDescription;
|
|
|
|
|
yeah, I started playing with JSON a while back - and the first time, attempted to do everything the hard way (I was used to a particular XML class that allowed very manual operations) - I eventually, after a lot of effort, got it done, then chucked it away and redid the operation by parsing JSON -> object(s) .. less than 1/3 of my original code
|
|
|
|
|
I just needed more data back this time around, to check for errors, someone got free shipping to Canada this week, and I didn't catch it.
I did parse it, just could not remember how to grab the child elements.
Oh Well, that was a waste of 2 hours.
|
|
|
|
|
I didn't know about the parsed function.
I ended up taking out the square brackets and revalidating the output, and grabbing the result as a non-array.
Just finished the implementation, but I do need to create a true json array in the next project on my to-do list.
Well thanks from brushing the rust off my head, it's been awhile and I completely blanked out on that one.
{
"result_StatusCode": 0,
"result_StatusMessage": "Success",
"result_WarningMessage": {
"Message": "Ship To Address Classification is changed from Residential to Commercial"
},
"result_API_Code": "12",
"result_API_Name": "UPS Three-Day Select®",
"result_Billing_SurCharge_Value": "$0.00",
"result_Billing_SurCharge_Currency": "USD",
"result_Billing_NetCharge_Value": "$8.29",
"result_Billing_NetCharge_Currency": "USD",
"result_Billing_Weight_Value": "01",
"result_Billing_Weight_UnitType": "LBS",
"result_ShipDate": "",
"result_DayOfWeek": "",
"result_DeliveryDate": "",
"result_Error": {
"ErrorSeverity": "Hard",
"ErrorCode": "111211",
"ErrorDescription": "The requested accessory option is unavailable between the selected locations."
}
}
var objB = jQuery.parseJSON(UPS.d);
var result_StatusCode = objB.result_StatusCode;
var result_Message = objB.result_StatusMessage;
var result_WarningMessage = objB.result_WarningMessage;
var result_API_Code = objB.result_API_Code;
var result_API_Name = objB.result_API_Name;
var result_Billing_SurCharge_Value = objB.result_Billing_SurCharge_Value;
var result_Billing_SurCharge_Currency = objB.result_Billing_SurCharge_Currency;
var result_Billing_NetCharge_Value = objB.result_Billing_NetCharge_Value;
var result_Billing_NetCharge_Currency = objB.result_Billing_NetCharge_Currency;
var result_Billing_Weight_Value = objB.result_Billing_Weight_Value;
var result_Billing_Weight_UnitType = objB.result_Billing_Weight_UnitType;
var result_ShipDate = objB.result_ShipDate;
var result_DayOfWeek = objB.result_DayOfWeek;
var result_DeliveryDate = objB.result_DeliveryDate;
if (0 == result_StatusCode) {
var result_Error = objB.result_Error;
var e_Severity = result_Error.ErrorSeverity;
var e_Code = result_Error.ErrorCode;
var e_Description = result_Error.ErrorDescription;
var m_Error_Text = result_API_Name + " -- " + "ERROR";
$('option:selected', '[id*="_ddl_RTSR_SARates_Unified_SelectRate"]').text(m_Error_Text);
$('[id*="_lbl_RTSR_Status"]').text(e_Description);
$('[id*="_lbl_RTSR_OrderInformation_EstimatedRate_Field"]').text("ERROR " + e_Code);
|
|
|
|
|
I know that there is an easy way to do this, but I'm so green on javascript programming that I'm missing something. Anyway, I have a div with some selects in it and I want to reset them all back to the first option. Here is my current code:
$("#newAuction").children('select').each(function () {
$(this).find('option:first').attr('selected', 'selected');
});
This isn't looping through all of the selects (there are four in this div) and resetting them to the first option. What am I doing wrong?
|
|
|
|
|
$('select option:first-child').attr("selected", "selected");
This will do all on a page. If you specifically want just the ones is a particular div then you can add that into the selector.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
how to create playlist in html5
i m using html5 along with visual studio2010
end of previous song next song should be start ..
how to pass dynamic source end of one song... it can be only by javascript
|
|
|
|
|
|
playlist and player are not the same.
playlist in xml format --> script for datas.
player in e.g. Javascript --> script for actions in use of datas.
So the end of a song --> e.g. inside of player in use of javascript function for timers (duration of song).
Please take Google to ceck possible players and owned playlist formats.
HTML 5 audio player is inside of every modern browser. Playlist data in different ways possible.
E.g. JSon, oder Array, oder xml (in use of xml DOM) or pure html code.
If you want see my webpage (twseiten.com) for HTML-5-player or BGSOUND-Player (older MS Internet Explorer).
In use of plugins like Flash or Java other players possible inside of HTML-5-Webpage.
visual studio2010 .... in use of MS Internet Explorer: This browser may be not compatible to
other browsers (e.g. webkit-browser Firefox, Opera becomes a webkit browser).
Other IDE .. Eclipse for Javascript AND webkit browser useable. Often browsers have an own
GUI to edit and debug html- and javasvcript code. Often only for webkit.
JavaScript Based Radio Player - see above of this entry in forum.
|
|
|
|
|
Hi everybody
I'm using highcharts API reference.
I want to know Where can I get the axis value when I click on a cursor?
Please help me!
|
|
|
|
|
|
Hi im doing an assignment Im only new to programming but at the start of my programming course witch will eventually teach me java, C# and objective C, im doing this assignment where you have to copy a file from a source folder that you put in the text box and put it in another folder witch you put in the other text box now I know how to do it when I create the path but I need to read the info that is put in the text box so I can do it with any folder name typed in.
you type a C:\\foldername\\andfilename.txt in one text box
then you type in destination C:\\foldername in another text box
then you press copy
that's the process, I can do that but only with a created path
help please................
|
|
|
|
|
You cannot work on system files/folders using JavaScript. It's a security issue and is not allowed. JavaScript is a client side thing.
|
|
|
|
|
I know the title says JS but the actual message says Java so likely it is a Java question. But your answer is correct about JS. It's easy for people unfamiliar with it to get those confused.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
ryanb31 wrote: but the actual message says Java
Yeah, did noticed that, but looked to me OP is talking of all languages he is trying to work on (m only new to programming but at the start of my programming course witch will eventually teach me java, C# and objective C, ).
But your point taken!
If Java, following will help OP: How to move file to another directory in Java[^]
|
|
|
|
|
He might be referring to Windows Script Host. Using JScript or VBScript, they have full access to filesytem just like any asp web server.
Q. Hey man! have you sorted out the finite soup machine?
A. Why yes, it's celery or tomato.
|
|
|
|
|
how to call server side function by javascript
|
|
|
|