Topic: need a little help with ajax

Ok, i don't speak HTML, javascript, css and all those things... only the basics

I am a bit out of space in some page in my site.
I thought i could use ajax to remove a div from the page and insert another one. The reason why i want to remove the first one is because they overlay.
This  ajax library appears to be pretty simple to use (I am fluent in php).
Just before i start writing any code... this is perfectly possible without any major tricks right?

Re: need a little help with ajax

Just getting rid of a div? You don't need AJAX, just simple JavaScript. Like this:

document.getElementById('yourdivid').style.display = "none";

3 (edited by pedrotuga 2007-05-03 17:14)

Re: need a little help with ajax

thank you

Re: need a little help with ajax

Ok... I created a toggle ( visible/invisible ) function i want to use in a few elements on a page, how do i set some elements invisible from the beggining?

Re: need a little help with ajax

Execute it through the body's onload handler.

Re: need a little help with ajax

Ok... i don't know how to use quotes in js, if i can escpae them, if single quotes is the same as double quotes, etc

None of these work, the second one for obvious reasons.

<a href="#" onclick="document.getElementById('checkboxes').style.display = 'none';">hide checkboxes</a>
<a href="#" onclick="document.getElementById('checkboxes').style.display = "none";">hide checkboxes</a>

Re: need a little help with ajax

They work about the same as in PHP; You can escape them, put special characters (\n) in double quotes, ...

And if something doesn't work, I suggest you open up your error console wink

Re: need a little help with ajax

I have no experience in javascript debugging.
I use firefox error console, but thats kind of unpractical. What console and/or other debuggind tools would you recomend me?

Re: need a little help with ajax

Have you tried the Firebug extension? I barely know any Javascript, but Firebug has gotten me out of a few tight corners nevertheless.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: need a little help with ajax

I don't see how it's unpractical: it shows the error perfectly.
And you can always install Console², that allows you to filter errors.