|
The Importance of AJAX
To understand the benefits of AJAX, consider a
renovation scenario. You’ve decided you want
a stained glass window beside the front door.
The renovator removes the existing plain glass
and window frame, takes it to the shop for
replacement with the stained glass, and returns
to reinstall it. He obviously has no need to
touch the other windows or — to be completely
ridiculous — tear down the house and replace
everything in the process.
The same concept applies to a Web page. If you
just want to change the content in one area of the
page, you don’t need to wipe out the existing page
and ask the server to resend all the images and
HTML markup. AJAX works like the renovator,
doing just what’s required but not more.
Jinal Desai
|
|
|
|
|
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have a Navigation Div...
<div class="navigation">
<a href="index.htm" class="mouseover">Home</a>
<a href="gallery.htm" class="mouseover">Gallery</a>
<a href="contact.htm" class="mouseover">Contact Us</a>
<a href="siteplans.htm" class="mouseover">Site Plans</a>
<a href="sitemap.htm" class="mouseover">Site Map</a>
<a href="cardington.htm" class="mouseover">Cardington</a>
<a href="r101.htm" class="mouseover">The R101</a>
</div>
This, functionally, does what I want, but I would like the elements to be spaced out evenly accross the Div.
Is there either a style command for this, or is there a way of putting spaces between the elements?
Thanks.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Use CSS to set the padding or margin.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks, just saw the SPAN in the second answer.
I knew there was a way.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
<style>
span
{
width:12%;
}
</style>
<div class="navigation">
<a href="index.htm" class="mouseover"><span>Home</span></a>
<a href="gallery.htm" class="mouseover"><span>Gallery</span></a>
<a href="contact.htm" class="mouseover"><span>Contact Us</span></a>
<a href="siteplans.htm" class="mouseover"><span>Site Plans</span></a>
<a href="sitemap.htm" class="mouseover"><span>Site Map</span></a>
<a href="cardington.htm" class="mouseover"><span>Cardington</span></a>
<a href="r101.htm" class="mouseover"><span>The R101</span></a>
</div>
... or maybe just use a table.
|
|
|
|
|
SPAN!!!!!
I knew it!
I was sure there was a control, but for the life of me I coulnd't remember it.
Thanks.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Suggestion Dave ...
If the menu, or other content, you want looks similar to an existing website, use Firefox with Firebug add-on. Then using Firebug you can establish exactly what the designers of the webpage were doing. Then do what a lot of programmers do, and "borrow" the code as a snippet, then modify it until your needs at satisfied.
So take the CP navigation on the green bar above, you can see the HTML and the Styles used, as well as any Javascript employed.
And talking of Javascript, you had couple of questions recently, point your browser here http://yuiblog.com/crockford/[^] and enjoy the learning experience. Caution, some of the resources there are huge.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Hi,
Below is the issue I am facing in Java script.
I am using <TR> in that Tr i have 3 <Td>
in last <td> I am using anchor tag dome thing like below
<tr name =row>
<td/>
<td/>
<td>
<a type="aaa" onclick="UpdateName" > test </a>
I am assigning dynamically all the attributes of anchor tag like below
var cells= row.cells;
var link = cells(2).all.tags("A")(0);
link.file= "123";
link.href = "javascript:VoidReturn("nothing to return");
link.onclik=function() { updateName(name);}
function Update(name)
{
username=name;
}
This is working fine if i am using link onclick attribute as above ...function() { updateName(name);}
but if i am just giving it as string, it is not invoking,
like below.
link.onclick=updateName('abc');
Please let me know how i can set onclick of anchor attribute without function object.
Thanks,
Salmon
|
|
|
|
|
salmonraju wrote: link.onclik=function() { updateName(name);}
OK the above assigns the Function to the onclick .
Now this next part assigns the results of
updateName('abc') (which is a function call)
to the onclick , you don't want that.
salmonraju wrote: link.onclick=updateName('abc');
I can't do anything with the code you presented so
I will give this simple example ...
<table>
<tr name="row">
<td>
<a name="a1">a1</a>
<td/>
<td>
<a name="a2">a2</a>
<td/>
</tr>
</table>
<script>
as = document.getElementsByTagName("A")
as[0].href = '#';
as[0].innerHTML = "HIYAS";
as[0].onclick = Update;
as[0].aname = "Davey"
as[1].href = '#';
as[1].innerHTML = "Whassup";
as[1].onclick = Update;
as[1].aname = "JONES"
function Update()
{
alert(this.aname);
}
</script>
Try that out and see if it works for you.
|
|
|
|
|
Great Answer
Jinal Desai
|
|
|
|
|
Project I am working on has a courtesy Weather.com Page. The intent is to display the client side weather conditions--not the server.
The HTML code from Weather.com looks like this:
<script type="text/javascript">
</script>
<div id="wx_module_7847" style="padding-left: 225px;" >
if (!document.cookie && document.cookie != "") {
Alert("Cookies must be enabled in Internet Explorer to use Weather.com<br />in the Aloha Manager's Desktop.")
}
if (!document.amdczip && document.amdczip != "") {
createCookie('amdczip', '40212', 365)
}
var wczip = readCookie('amdczip')
document.write('wczip')
<a href="http://www.weather.com/weather/local/34979">Your City's Weather Forecast, AA (11111)</a>
</div>
<script type="text/javascript">
/* Locations can be edited manually by updating 'wx_locID' below. Please also update */
/* the location name and link in the above div (wx_module) to reflect any changes made. */
var wx_locID = '08043';
/* If you are editing locations manually and are adding multiple modules to one page, each */
/* module must have a unique div id. Please append a unique # to the div above, as well */
/* as the one referenced just below. If you use the builder to create individual modules */
/* you will not need to edit these parameters. */
var wx_targetDiv = 'wx_module_7847';
/* Please do not change the configuration value [wx_config] manually - your module */
/* will no longer function if you do. If at any time you wish to modify this */
/* configuration please use the graphical configuration tool found at */
/* https://registration.weather.com/ursa/wow/step2 */
var wx_config = 'SZ=300x250*WX=FHW*LNK=SSNL*UNT=F*BGI=spring*MAP=null|null*DN=askbillbradley.com*TIER=0*PID=1177763389*MD5=be2899d91f6feddef8216cd03ec459a7';
document.write('<scr' + 'ipt src="' + document.location.protocol + '//wow.weather.com/weather/wow/module/' + wx_locID + '?config=' + wx_config + '&proto=' + document.location.protocol + '&target=' + wx_targetDiv + '"></scr' + 'ipt>');
</script>
The VAR var wx_locID can be changed under license. However, I am having a difficult time requesting a Zip Code using a form/input, saving it as a cookie for future use, retreiving that cookie and assigning its value to the var wx_locID.
It var exists inside a script. I cannot modify that script per weather.com terms and conditions, but I need to pass the zipcode to it.
Any assistance would be appreciated
|
|
|
|
|
Hello everyone,
I need help to implement the following capability on a simple web site:
1. when the user clicks a link, a page is displayed that says "if your download does not start
automatically...etc" with a bunch of other HTML stuff.
2. the download is automatically initiated (the browser displays the save file dialog box) after
the above page displays.
3. the file has an .exe extension, and I want to minimize the various doom warnings that
different browsers, esp. IE generate.
4. Ideally this should be done using a generic method such as JS (not ASP/VB/.NET)
I am completely stumped by #2 and #3, because of my low web development experience (besides plain HTML).
The various PHP recipes I've found do not work. I cant even reverse-engineer it from other web sites!
I am sure all of you have seen this functionality, which may be easy for you. Please help... in return, I can answer complex C++ questions if anyone still uses that
Thanks!
Ted
|
|
|
|
|
1. OK, create a page.
2. Add this script
<script type="text/javascipt">
setTimeout("window.open('file locaiton','Download')",5000);
</script>
3. Not possible. Think about it, the warning are there for a reason why would they provide a method to override them by any ordinary person?
4. No idea waht you mean. Generic?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
signing the executable will offer some assurance to your users.
|
|
|
|
|
And how does this relate to the question that was asked.
Signing doesn't mean a thing, anyone can purchase a certificate, even hijack one.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You may know better, but doens't IE have an option to check for certificates on downloaded code. If a downloaded exe is not signed, doesn't IE present another warning dialog box? Isn't that want you wanted to reduce?
With regard to the ability to subvert security mechanisms, you raise a good point. There are probably a large number of other techniques you can use to minimize warning dialog boxes.
|
|
|
|
|
hb52134214 wrote: If a downloaded exe is not signed
That's the point, it could be signed and still be nefarious. Signing is no guarantee of validity or safety.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Create a php page (if you are using php or just modify the code to suit your language. The concepts are the same because we are dealing with HTTP so languages dosent matter).
Add this code...
http://vikku.info/codesnippets/php/force-download-authenticated-download/[^]
---
$filename = "anyfolder/anyfilename.ext";<br />
header("Cache-Control: no-store");<br />
header("Expires: 0");<br />
header("Content-Type: application/octet-stream");<br />
header("Content-disposition: attachment; filename=\""."anyname.ext."\"");<br />
header("Content-Transfer-Encoding: binary");<br />
header('Content-Length: '. filesize($filename));<br />
readfile($filename);
---
just give a link to this file...
the result is this page will not load instead the download dialog box is triggered and this is the one you were expecting...
so as the previous person has posted...
window.setTimeout("location to the file",3000) // after three seconds...
location to the file should be replaced like this
window.location = 'folder/filename.ext'
thats it... done.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
plz help i want to add an image in an empty box(rectangular space) when i click on it
|
|
|
|
|
Make a transparent gif the same size as the one you want to display and call if blank.gif. Then do this (assuming the real picture is real.gif).
<div style="border:1px solid black;"><img src="blank.gif" onclick="this.src='real.gif';">
</div>
|
|
|
|
|
I have created an XML web service in Visual Studio 2008. My solution consists of two projects, one is a simple web site and the other the .asmx project. (Microsoft self-paced training kit Exam 70-562 - Creating and consuming ASP.NET web services, Page 624)
The Reference.vb file containing the proxy class is not appearing, only the .disco, .discomap and .wsdl files appear. Yes, I have clicked 'show all files'.
Yes, I know I don't need to and should'nt modify this file in any way, but I need to know why it is not there? More errata perhaps from Microsoft. ??
Everytime I buy one of these books, my first task is to go through with a pencil having to check and correct all the errata!!
Can anyone help?
|
|
|
|
|
Does the webservice work, ie has it actually generated the proxy?
I've known for VS to silently fail when generating those files if there's an access issue. Usually, restarting VS with Administrator permissions sorts it, there should be more info in the Application Event Log.
|
|
|
|
|
I runs perfectly. The asmx code-behind accesses an .mdf table in the App_Data folder of the web service appliation, via a webmethod and displays it on a Gridview control on the .aspx page.
There are no errors and no warnings at all!
I am using the local ASP.NET development server built into VS2008.
Incidentally, where is the app event log ??
|
|
|
|
|
The Windows Application Event Log (Run->eventvwr->Windows Logs).
Can you see the files in Windows Explorer?
If so, try switching the toggling the 'View all Files' off and on again in the Solution Explorer.
Beyond that I'm stumped, sorry.
|
|
|
|