...

View Full Version : JavaScript Click and Focus Facebook status update text Box



Dragon Bird
12-21-2011, 10:00 AM
Hi,
I am trying to implement something like a javascript that can click and focus the Status Update Box on Facebook. Till now, I have nothing in hand that can perform the task so I thought about a javascript that can do it.
I am not even a newbie to javascript but I know that it can perform various complicated tasks on client side.
Can anyone here tell me how do I click the Status Update box and set it to focused by a javascript so that when I start typing the Status box receive the text ?
Thanks :)

Apothem
12-21-2011, 10:15 AM
I suggest you look into JS frameworks like jQuery, Prototype, etc.

Though, I've only used jQuery. To focus on something, I would just do:
$("#searchbox_id").focus()

I am not sure how other frameworks work, but it is likely very similar.

Dragon Bird
12-21-2011, 12:37 PM
I suggest you look into JS frameworks like jQuery, Prototype, etc.

Though, I've only used jQuery. To focus on something, I would just do:
$("#searchbox_id").focus()

I am not sure how other frameworks work, but it is likely very similar.

Actually I tried many things before posting it here, I guess there are 2 or more elements playing a combined role in activating and focusing the textbaox on facebook page. it is a chain of 2-3 javascripts that finally activate the textbox upon a click on a div.
I am totally lost in DIVs please help. can you have a look at the page and figure out what happens when you click on the the text box "What's on your Mind ?"
Thank you for your reply.

Apothem
12-21-2011, 09:49 PM
Actually I tried many things before posting it here, I guess there are 2 or more elements playing a combined role in activating and focusing the textbaox on facebook page. it is a chain of 2-3 javascripts that finally activate the textbox upon a click on a div.
I am totally lost in DIVs please help. can you have a look at the page and figure out what happens when you click on the the text box "What's on your Mind ?"
Thank you for your reply.

While I will not inspect the inner workings of Facebook, I will try to tell you what I think is happening.

You are given a box. Let's give it an id, say, "mind".
The "mind" box has a focus event AND a blur event.
When this focus event is triggered, there is some code that adds some HTML related text after the "mind" box. More over, the "mind" box has been slightly enlarged. This is key. The main reason for why it does not re-enlarge or re-add code is because one does need to check if the rows/height is different from the original.
- The color attribute of the "mind" box's CSS is then changed.
When there is a blur (i.e. you click elsewhere), that same color attribute is changed back to its original value.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum