...

View Full Version : What is this code called?



shuban
02-25-2011, 06:59 AM
I would like to know how this person is able to switch between search forms by simply clicking the links "dictionary | site wide". What is this code called? I checked the source code, but it doesn't provide me with much information. Any opinions? Ideas? It's not so much important to know how the search form switches, I think just by knowing the code generally, I will be able to deduce how the form switches.

>> http://www.biology-online.org/dictionary/Main_Page

Thanks

Stooshie
02-25-2011, 09:54 AM
They are using JavaScript to control the style sheet properties of the elements on the page.

shuban
02-25-2011, 05:23 PM
They are using JavaScript to control the style sheet properties of the elements on the page.

Oh, do you know the name of the code? So that I can search it up on Google?

Stooshie
02-25-2011, 05:50 PM
I think they have probably written it themselves. View the source code, then look for a reference to a file called script.js then download that file.

shuban
02-25-2011, 06:10 PM
I think they have probably written it themselves. View the source code, then look for a reference to a file called script.js then download that file.

Thanks. It's a mediawiki so the scripts are all jumbled up. Probably would give an accurate representation of the code I'm looking for.

quartzy
02-26-2011, 01:43 AM
It may be copyrighted so I would not download it.

oesxyl
02-26-2011, 01:49 AM
It may be copyrighted so I would not download it.
is free but have a creative commone licence:


To grow the commons of free knowledge and free culture, all users contributing to Wikimedia projects are required to grant broad permissions to the general public to re-distribute and re-use their contributions freely, as long as the use is attributed and the same freedom to re-use and re-distribute applies to any derivative works. Therefore, for any text you hold the copyright to, by submitting it, you agree to license it under the Creative Commons Attribution/Share-Alike License 3.0 (Unported). For compatibility reasons, you are also required to license it under the GNU Free Documentation License (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Re-users can choose the license(s) they wish to comply with. Please note that these licenses do allow commercial uses of your contributions, as long as such uses are compliant with the terms.

http://wikimediafoundation.org/wiki/Terms_of_Use

http://www.mediawiki.org/wiki/MediaWiki

best regards

quartzy
02-26-2011, 02:00 AM
HI Oxes
Good you found out that it was free, to me it sounded like the other person was telling the enquirer to download a script that a coder may have written themselves, ie copyrighted perhaps.

Stooshie
02-28-2011, 10:30 AM
Clicking on dictionary/site wide calls a function called switch_menu() which is about 10 lines of code (looks like a self-written script, with no copyright info) which sets display style on the search boxes to display the correct one.

Googling getElementById will give you the code you need to change the display.

Their google(sitewide) searchbox is the standard google search box that any site admin can get from google. Their own search box will be a custom search written into the wiki.

In summary

Changing the layer to display (switch_menu) is a very easy function to write (so easy that using it would be very unlikely to cause a problem). The div containing the google search is easy to obtain from google and their own custom search will be part of their wiki.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum