riahc3 50 Â Team Colleague

Thank Dani :) You seemed to have fixed it and now it shows.

riahc3 50 Â Team Colleague

No problem. We are all here to help and get help.

riahc3 50 Â Team Colleague

Certainly was one of my problems! Thankyou very much for your assistance - I have half of my script working now - the values are being passed.

Now I just need to make the <option></option> appear in my second menu now that the array is responding with ["1","2","3"].

I was advised not to put html in my ajax.php file for some reason. So now to figure out how to spit it out :)

Step by step.....Thats good that now it replies.

I imagine that now that you know how Firebug/AJAX works you will have more knowledge on how to debug this. You could also download FirePHP to debug even further.

riahc3 50 Â Team Colleague

You're luckiest dev to have just an IE9+ requirement.

Anyway, riahc3 please mark this as solve if you got your answers to your queries.

Devs have to start putting down their foot saying it just cannot be done in a modern browser. Noone should be running IE6 or less.

Clients usually believe anything. They will believe explorer.exe is a virus if we convince them.

riahc3 50 Â Team Colleague

Not really, somebody posted some code with the following line:

....??? I posted it :P Only three people have posted in this thread and you couldnt see it was me?

riahc3 50 Â Team Colleague

Hello

Now that I know how to get the width/height, how can I detect if the browser is maximized or not?

Crossbrowser of course.

Thanks

riahc3 50 Â Team Colleague

yeah, but person who has web understanding easily unhides those dis and see the video.

Yes but then again I didnt know who your target audience is....

Then have them login, call a PHP page (or via AJAX) and have the server return the div/video/etc. if the login is correct.

You could go with what I posted but it is nonstandard and I have no idea what browsers support it.

riahc3 50 Â Team Colleague

document.documentElement.clientHeight is working pretty good on all....

I just need IE9+

riahc3 50 Â Team Colleague

Actually it's not that simple to get the size of the the window on different browsers, it can give you a lot of headache. :D For FF, if you're after the browser window size, then use window.outerWidth and window.outerHeight. But then, if you want to get the viewport, it's document.documentElement.clientHeight and document.documentElement.clientWidth.

Damn it.

Then what ways can be done? Lets leave it to IE9+, Firefox, and Chrome. Fuck Opera.

riahc3 50 Â Team Colleague

looks lot of work to understand and implement. But thanks.

That should be the least of your worries; Its nonstandard.

A way (this is off my head so it might not be perfect and might have a huge overhead or might not even work) is preload them in hidden divs or something, then when the user logs in, unhide those divs. Online encryption is usually server side AFAIK.

riahc3 50 Â Team Colleague

I just noticed something when I was posting your code on here to reply to you:

$t2=$_GET["t2choice"];

Should be

$t2=$_POST["t2choice"];

Sorry about that.

The reason it works when you directly call http://yoursitee.com/ajax.php?hi=hello is because there you are passing it as a GET value and not as a POST value while in this AJAX call you are passing it as a POST value and your ajax.php expects a GET value. Try this out.

So you can do that or change in the ajax call to "type:GET" or put (not recomended)

$t2=$_REQUEST["t2choice"];

My personal recommendation is to change in the ajax.php to a $_POST

JayJ commented: Superb spot! Thankyou very much! +2
riahc3 50 Â Team Colleague

Here is a bit how you would see what I see.

You open up Firebug and refresh the page. You hit that tab (it should be network) and then change the dropdown to something else. As soon as it does that, you should see POST ajax.php appear. From there you can select Post, which will show the post variables passed. Reply which shows the reply the PHP page has sent back. And HTML which is like Reply but if the Reply has HTML code, it will be rendered as such.

http://img145.imageshack.us/img145/5854/44653098.png

I put a PNG just in case. Any questions just ask

riahc3 50 Â Team Colleague

OK, just looked at it....

Good news: Your parameters are being POSTed corrected, the page can be reached and it replies. Bad news: Its repling "".

Just in case do this test on your ajax.php page:

<?php 
$t2=$_GET["t2choice"];
echo $t2;
?>

This should just send back what you POSTed as a reply....

riahc3 50 Â Team Colleague

Yes, the "viewport" (I guess you ment "viewpoint") is what Im after. Ill try it shortly.

riahc3 50 Â Team Colleague

Sorry slightly off-topic - avoid async: false. Here's a recommendation: http://stackoverflow.com/questions/6902174/tactics-to-avoid-using-asyncfalse-with-jquery

Slightly? Completely.

riahc3 50 Â Team Colleague

But........really it has no point :S

More than login page, it shows how a if works.

riahc3 50 Â Team Colleague

Ill have to leave in less than 8 minutes so if I dont reply its because of that...

riahc3 50 Â Team Colleague

By your post, then yes, you should do change on t2. Whenever you change on t2, you modify t3.

riahc3 50 Â Team Colleague

Trust me, AJAX is a bitch so its normal the first time around this doesnt work :P

You can see AJAX events (with POST and GET) using Firebug. In the network tab, whenever a change is made (in your case as thats the event being fired) it should show the call. It should show you the reply, HTML reply, POST/GET etc.....

As a matter of fact, if you want, PM the address as I can see the page you call yourself and I can see what you pass and the reply. I cant see the PHP code (dontworry) just the reply and what is passed.

riahc3 50 Â Team Colleague

I find it very difficult to believe that something so simple such as window height/width noone knows why it doesnt work.

My code is a simple popup showing those two values....

riahc3 50 Â Team Colleague

Apologies - thats my lack of simplifying my code. brigade should read t3choice

I have adjusted both var to .val as you suggest that both should be the same. This is where I have been going wrong as I have been lifting snippets of code from various sources and piecing them together.

Firebug pointed out a missing "}" - and then a missing ")" - not sure where these are from, but having placed those no further errors are showing.

Upon changing the value of the first drop-down, the second menu is not displaying.

Thankyou very much for your assistance so far

No problem, we all copy/paste....

Anyways, thats one important step: No errors such as missing ")" or "}".

But, you said it should be "t3choice". Personally that makes no sense; When you change t2choice, it should populate t3choice, not the other way around.

I apoligize if I am not understanding something correctly.

riahc3 50 Â Team Colleague

One thing that should be remembered is that no software is perfect, and this applies especially to more complex packages. Then also consider that the 'net, and the browsers used to surf it are in perpetual transformation. Finally, consider the OS all of your projects are working through.

But, if clearing the cache is what may help this problem then this Clear Cache Extention for Firefox is worth trying. (You did say Firefox didn't you?) This extention places a button on your browser, and with one click your cache is clear.

Like I mentioned, my cache is disabled.

riahc3 50 Â Team Colleague

I completely agree. JQueryUI's Datepicker is great and allows you to customize things to your extent. Sad that sometimes you have to load that library JUST for the datepicker...

riahc3 50 Â Team Colleague

If it intrests you, I do something similar except with a database:

html:

<div id="fa"></div>

php:

myfun: function()
    {

        $j.ajax({  // Start AJAX function                                     
            url: 'mysqlcall.php',                  //script that gets the data     
            async: false,                           //for me it had to be async
            data: "pam="+varpam,                        //url argumnets here to pass
                                            //for example "id=5&parent=6"
            dataType: 'json',                //data format      

            success: function(data)          //on recieve of reply
                { //start success function

               var selecthtml='Dropdown: <select name="dd" id="dd">'

                    for (var i=0;i<data.length;i++)
                        {    //start for  

                            var row = data[i];          
                            var name = row[0]; 


                            var coo = row[1]; 

                            selecthtml=selecthtml+'<option value="'+coo+'">'+name+'</option>';



                        }  //end for
                        selecthtml=selecthtml+'</select>';
                           $j('#fa').append(selecthtml);



                        } //end success


    },

Hope it gives you some ideas.

riahc3 50 Â Team Colleague

Also, I personally dont know what "brigade" is. Does Firebug's console do anything when the event change is fired on brigade?

riahc3 50 Â Team Colleague

Why

var t2choice = $('#t2choice').attr('value');
var t3choice = $('#t3choice').val();

?

They SHOULD both be the same but...

riahc3 50 Â Team Colleague

Closest you are going to get:

https://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html

Other than that, you'll problably have to do some kind of server side login....

riahc3 50 Â Team Colleague

Hello

Lets clear it up a bit: I want to get the width and height of the browser window where I can click. This does not include scrollbars/toolbars. I thought it was with innerheight/width. Strangly, width works (I resize it and onload shoots a alert and it is changed) but height does not work. It stays a fixed value.

Whats wrong?

Firefox 18.0.1

riahc3 50 Â Team Colleague

Nothing on this? At all?

riahc3 50 Â Team Colleague

Hello

What is a universal way to make a windows/browser maximized or fullscreen? I understand user intervention is neccesary so it can be a button even though I perfer automatically (even if it is maximized instead of fullscreen)

Thank you

riahc3 50 Â Team Colleague

So let me get this straight:

You want a form that you can login or register.
If you register, it asks you to put a username, password and (for example) telephone, address, email, etc
If you login, it shows you your telephone, address, email, etc....

All this information is stored in a file. What kind of file: text, csv, xml, etc?

Correct?

riahc3 50 Â Team Colleague

Yup, just like I said

BufferedImage.TYPE_BYTE_BINARY

Reduces a black and white BMP from 744kb to 33kb. Huge difference especially when FTPing over a VPN.

Solved by me.

riahc3 50 Â Team Colleague

Hello

Im currently creating BMPs as a bufferedimage as following:

BufferedImage bufferedImage = new BufferedImage(320, 320, BufferedImage.TYPE_INT_RGB);

Thing is that black and white is more than enough for me so would I do this:

BufferedImage bufferedImage = new BufferedImage(320, 320, BufferedImage.TYPE_BYTE_BINARY);

?

Thanks

riahc3 50 Â Team Colleague

Its too bad we couldnt do this with sessions...

riahc3 50 Â Team Colleague

Done.....I was able to do it with cookies.....

riahc3 50 Â Team Colleague

OK, Ive switched to cookies which seems to do it on my local server, but doesnt work on the production server....

riahc3 50 Â Team Colleague

Lets try to analize a bit the problem some more. Ill post some variables up.

page 1:
frontend (Cookie, value 1)

page 2:
frontend (Cookie, value 1)
PHPSESSID (session, value 2)

page 3:
frontend (Cookie, value 1)
PHPSESSID (session, value 2)

Does this mean anything?

riahc3 50 Â Team Colleague

OK..........i think it is that...........

The problem is now when I try to change the value, I cannot. It only gets the initial value it is assigned to....

riahc3 50 Â Team Colleague

Hi Riahc3,
Saw some issues with Magento's sessions. Hope these helps.

Magento Session Issue
Magento Session Issue 2

Man, we sure made a lot of pages on this thread. We're on page 4. LOL

Yes, I agree with some of the comments on that thread.....I believe Magento has a hidden "session_start" somewhere and me calling it twice is kind of the problem.....Obviously debugging this is very difficult but...

riahc3 50 Â Team Colleague

Evercookie - looks intrusive - I don't think I'd want it on my machine. Persisting data should be done with sessions IMO.

I completely agree; As stated on the wikipedia, its used for marketing purposes. But I just want this to work. Really dont care how :)

The issue here is not the code we're looking at. The previous code I gave you, as you said, worked. We can take out the issue of having a persistent storage for calle, those codes are intended to prove that the session retains.

There's quite a small opening for us to conclude the problem here was recent code we have, since the posted code, already works. The issue was there's a part of you code or process that changes and the session calle also. And I assume it was another framework.

Well I simply do not know where to even look anymore. I do know there was a point in all this testing that it actually did work; The only moment that it did not work was when I changed the value of the drop box....it stayed the same value.

I posted the code that did work and I put it again but not it doesnt work. Thats why this problem is so confusing and simply makes no sense....

I think my best shot is to implement that Evercookie as this will work across all sites.

riahc3 50 Â Team Colleague

BTW, if there are any alternative ideas to this (carry a value thruout a site) Id be happy to hear.

Im currently looking at this: http://samy.pl/evercookie/

riahc3 50 Â Team Colleague

Nope........nothing. Did this, selected somethinf from the dropdown (trigging on change) and nothing

riahc3 50 Â Team Colleague

Man this is stressful..........

Now I have to play with it in AJAX.....
That "imaginary page" (the page before billing.pthml) is sorta a resume of the cart. I put it there as:

<?php
if(isset($_SESSION['calle']))
 $_SESSION['calle']=$_SESSION['calle'];
 else
 $_SESSION['calle']="im session";
?>

At its initial value, no, it should have nothing. It should just load what is in the dropdown box and refresh when it is changed.

Basically copying/pasting that code you put and see if it works.

riahc3 50 Â Team Colleague

Ive done step 1 and now the session variable eaches the "end". It exists.

Now I have to play with it in AJAX.....

riahc3 50 Â Team Colleague

Another thing, do I include the "onchange" in the document ready function? I had

document ready
start ready
finish ready

change
start change
finish change

Do you want me to do:

document ready
start ready

change
start change
finish change

finish ready

riahc3 50 Â Team Colleague

Correct me if I'm wrong. What you wanted was to send an ajax request based on the dropdown's value?

What I want is a session variable that is visible accross all of the site. I dont care if its a AJAX request or if I have to do it in Flash :P

Im sorry but I believe you are going to have to reexplain...

STEP 1:
(Page before billing.ptml) do form fill up

isset($_SESSION["calle"]) === TRUE

Session variable 'calle' doesn't exist yet.

Do you want me to simply put:

<?php isset($_SESSION["calle"]) = TRUE ?>

And thats it? I thought isset was usually used in a if....

STEP2:

I imagine that you simply want to me to load the dropdown box and then assign directly the session variable to the first value. This is no problem.

STEP2 (which I imagine is 3):

In the JS side, currently everything is how you put it. Ill put what you put on the PHP side.....

I just need to clear STEP1 up a bit as I do not understand what you mean.

Thank you.

riahc3 50 Â Team Colleague

Everytime the pages loads up, two things happen:

1: A dynamic (eg. PHP) drop down menus is created with values from a database.
2: The document ready function gets that value.

They are also executed in this order because the document read does indeed get the value.

This line you said:

So if it starts with the value 5, the one will
// be sent to the server is the value 5 always.

This is something similar to what happened initially. I changed the value, the drop down changed event shot out, but even if it changed, the initial value was still the same. I copy/pasted the code between doc ready and dropdown change because they are going to do the same thing.

Ive changed it between the absolute path and the relative path; Both give the same results. I know I am editing the correct file because there are changes (the output of echo for example)

$_POST['calle'] will ALWAYS have a value. Its a dropdown menu.

Personally, no. jQuery is declared as $j because Prototype uses $. Prototype is there because Magento uses it.

This code is for use in a Magento project.

What do you want me to do now? I can do back to that initial post and we can try again...

The odd thing is that it was working at one point; I tried the changing event but it only got me first and initial value....

There are three pages involved here:

riahc3 50 Â Team Colleague

Hello

Im currently using Magento but everytime I run into any type of (even small) problem, there is basically no comunity to help out. Thats why Im looking to migrate to something (free as well) with a large and very active community.

What suggestions would you guys give?

riahc3 50 Â Team Colleague

So now what do I look for? This problem is so complex and Ive been at it for weeks :(

riahc3 50 Â Team Colleague

OK, i did it in a seperate folder and the first one gave the expected result and the second one:

 SESSION ID(ON LOAD): 4updnokejc27updjo5l1r32993

RECIVED DATA
SESSION ID: 4updnokejc27updjo5l1r32993
FRUIT: "Mango" 

So like you mentioned, server and browser seem to have no problems/issues.