|
|
You want to make a website with the navigation in ajax
(exemple <a href="javascript:LoadPage1()"> page1 </a> refreshing the mainarea of your page to show the right page)
This approch brings a very reactive website but brokes all standards for the users :
Maybe your users want to open your page in a new tab or in a new window
Maybe your users disables javascript
So I give you a very small and simple implentation of a link which :
- Launch a javascript(ajax) method when the user just click on it with javascript enabled
- Make a classic navigate when the user just click on it without javascript
- Make a classic navigate on a new tab/window if the user click on it with :
* the middle button
* CTRL pressed
* SHIFT pressed
-----------------------------------------------------------
<!-- [reusable functions] -->
<script type="text/javascript">
function SmartLink(evt, sender, ajaxJs)
{
var ctrlid = sender.id;
var ctrlhref = sender.href;
sender.href='';
var btn = evt.button;
var IE=navigator.appName=='Microsoft Internet Explorer';
if(!IE){ btn ++ ;}
var classic = false;
if((btn < 2) && (!evt.ctrlKey) && (!evt.shiftKey))
{
eval(ajaxJs);
setTimeout("SmartLinkRestaureHref('"+ctrlid+"', '"+ctrlhref+"')",1);
}
else
{
sender.href=ctrlhref;
}
return false;
}
function SmartLinkRestaureHref(cid, url)
{
document.getElementById(cid).href = url;
}
</script>
<!-- [/reusable functions] -->
<script type="text/javascript">
function MyAjaxLink1()
{
// my ajax method
alert('i can make a ajax call here');
}
</script>
<a id="SmartLink1" href="http://www.google.com" onmousedown="SmartLink(event, this, 'MyAjaxLink1()');">my smart link 1</a>
-----------------------------------
very simple here but maybe a good thing to be packaged
-- modified at 6:12 Wednesday 15th November, 2006
|
|
|
|
|
You do realize this that is not how you post an article?
Welcome to CP BTW
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
it's just a short tip i don't want to post an article with 10lines of javascript lol
|
|
|
|
|
Mmm. but if you post an article then it'll not get lost in the forums...
|
|
|
|
|
ok i will do that
thanks guys
|
|
|
|
|
I’d like to show a 'gallery' of uploaded videos that are available to the user, similar in principle to that shown in windows explorer when viewing a directory of videos.
Not sure how to do it.
I’d like the first frame of a video to be displayed to give some indication of content, and I wonder if anyone knows how to do that without going to the trouble of playing the first frame, capturing it, and displaying it as a static graphic.
Thanks in anticipation.
|
|
|
|
|
Well the first graphic thing may be hard.
The other things are simple, simple store in a database the location of each video, its title and any the information. Then call it from ASP/PHP/PERL/OTHER CGIs/RUBY/FLASH/JAVA/WHATEVER (ok not so much flash or java)
and use the same system you use for displaying any other data, then set a link to open the file path when clicked.
I would say the easiest way to display the image would be to have it uploaded separately.
That being said, it is also an option to have a separate program take the image for you, if you have a dedicated/virtual server you are working from.
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
Thanks.
I have managed to create a gallery, but displaying the thumbnail of each video in the gallery is the question I am chasing, yes.
|
|
|
|
|
You may want to look into WPF / .NET3.0 for this - some fairly good multimedia and graphical capabilities
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
not so much "misinterpret", but just not sure what is .Net3.0, nor am I sure what is WPF .
Soz for being so dumb, but gratefully received answers.
|
|
|
|
|
SexyKitten wrote: Soz for being so dumb
Don't be silly - we all have to start somewhere!
.Net 3.0 is the new version of the .NET framework, which is what all the code that we write (well, most of us) "targets" - it provides "services" exposed as objects that we can use in our own apps, so that we don't have to write all the code ourselves. For instance, the framework provides an Image class, which allows you to (for example) show an image without having to write bytes to a particular area of memory as we used to have to in the olden days.
The new verison has implemented some new technologies which improve on various parts of what we have at the moment - such as Windows Communications Foundation for comms / protocols, WF for "Workflow" type tasks, and Windows Presentation Foundation for graphical stuff.
The best resource for starting out is probably http://www.netfx3.com/[^], which will allow you to download the latest version of the framework, and some tools to help.
The WPF stuff in particular seems to offer an awful lot - from integrated handling of 3D graphics to multimedia etc...for instance, to show a video in a webpage, an example of which can be found here[^].
As with anything techy - there's alot to learn, but if you can get your head around it, it's well worth the effort.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Wow !
The .Net3 looks superb!
Thanks for that. I'll take a look and see if there's any functionality that meets my needs, but it looks like extracting frames is straightforward.
Thanks again.
|
|
|
|
|
SexyKitten wrote: Thanks for that. I'll take a look and see if there's any functionality that meets my needs, but it looks like extracting frames is straightforward.
That's not a problem - here to help (and of course your name "peaked my interest" )
If you have any probs, feel free to post, and I'll see if I can help.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
pItem1Ptr->put_innerHTML(L"");
The code above is to change something in the HTML.
It works well in IE6,I can get the gif picture successfully.
But when I run my code in IE7, this code can't work........and I found that, if I replace c:\\float.gif into http://somesite/somepic.gif It can work nice. So I think there maybe something changed in IE7, can anyone tell me how to show my c:\\float.gif picture in IE7????
|
|
|
|
|
Hi Friends,
I have developed an application in ASP, I Want to project the coding from the client.. that is I Want to Make project as an EXE File
If any one knows tell me dears..
|
|
|
|
|
The client can not view the ASP code, you don't have to do anything to protect the code from the client.
---
b { font-weight: normal; }
|
|
|
|
|
Additionally, you can't make an exe from a website project
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi Friends,
I have developed an application in ASP, I Want to project the coding from the client.. that is I Want to Make project as an EXE File
If any one knows tell me dears..
|
|
|
|
|
|
Hi all,
I am facing a problem in ASP project. Can anyone plz help me with validation of an html page. I want to validate the fields on an html page and then submit the details in the database. I am able to add the details to the database. But if any of the field remains empty, then that particular column remains empty in the database. I am also able to display a message on the neext screen, if the user clicks on Submit. I want a message to be popped up at the screen itself.
I urgently need some help...Plz let me know.
Thanks in advance
Regards,
Shraddha
|
|
|
|
|
Check out the validator controls that come with ASP.Net. You associate one validator control per field and they do all the magic for you. If you do not use ASP.net, you can use JavaScript.
|
|
|
|
|
I have to disable back button, I have disabled the back button functionality already by using History.Forward(), please help me to disable the back button at earliest.
|
|
|
|
|
I know it is doable but can't remember the syntax.....
But remember that users don't like site making navigation annoying.
Brad
Australian
"The Probability of you doing that makes 0 look like a big number" - My Mate Oxley
|
|
|
|
|
Please send me code if possible .............
|
|
|
|