Solved

php javascript widgets

Posted on 2008-10-07
7
305 Views
Last Modified: 2013-12-13
hi guys ,
             i want to create the widgets like on this page
http://affiliate.workcircle.com/login
please click on that page and look at that 4 types of widgets .

add to my blogger , typepad,snipperoo
html widgets for my website


please guide me how to do that ?
0
Comment
Question by:jamie_2008
  • 2
  • 2
7 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 22660283
You are better off contacting support at workcircle.com since most likely you need to create an account with them so you get paid. Following the links on that site (without registering) do not seem to give you anything to install on your server.

0
 

Author Comment

by:jamie_2008
ID: 22660372
no , i dont  .. i wanna know .. how to create the widgets  ..
i m not concerned with the affiliate system ..

i want to know ..how to make it this code ?

<script type="text/javascript">
<!-- Feel free to change this -->
wc_background_color = "#ffffff";
wc_width = "150px";
wc_font = "10px verdana, arial, helvetica, sans-serif"
wc_font_color = "#996633";
wc_link_color = "#336699";
wc_border_color = "#D1E0F0";
wc_title_font = "12px Arial, Helvetica, Sans serif";
wc_title_font_color = "#ffffff";
wc_title_background_color = "#6699CC";
wc_title = 'Top UK Jobs';
<!-- Do not change this -->
wc_affiliate_id = 0;
</script>
<script type="text/javascript" src="http://widget.workcircle.com/?q=software%20engineer&n=5&a=0&i=1"></script>

above is the core part of code that i need to know ,,how it works ..
<!-- Workcircle Widget Copyright (c) 2007 All Rights Reserved. use permitted only on terms which can be viewed at http://www.workcircle.com/affiliate-terms -->

<noscript><a href="http://www.workcircle.com">Jobs</a> from Workcircle.com</noscript>

<script type="text/javascript">

<!-- Feel free to change this -->

wc_background_color = "#ffffff";

wc_width = "150px";

wc_font = "10px verdana, arial, helvetica, sans-serif"

wc_font_color = "#996633";

wc_link_color = "#336699";

wc_border_color = "#D1E0F0";

wc_title_font = "12px Arial, Helvetica, Sans serif";

wc_title_font_color = "#ffffff";

wc_title_background_color = "#6699CC";

wc_title = 'Top UK Jobs';

<!-- Do not change this -->

wc_affiliate_id = 0;

</script>

<script type="text/javascript" src="http://widget.workcircle.com/?q=software%20engineer&n=5&a=0&i=1"></script>

<!-- PLEASE DO NOT EDIT THIS BIT -->

<div align="center" style="padding-top:3px; height:27px; background-color:#E8F0F7; border:1px solid #D1E0F0"><a href="http://www.workcircle.com?a=0" target="_blank"><img src="http://widget.workcircle.com/images/logo-widget2.gif" width="106" height="26" border="0" alt="Workcircle - marketing jobs, london jobs, law jobs, engineering jobs, financial jobs, all the top jobs!" /></a></div>

</div>

<!-- THANK YOU! -->

Open in new window

0
 
LVL 82

Expert Comment

by:hielo
ID: 22661073
on the code you pasted, you have this:

<script type="text/javascript" src="http://widget.workcircle.com/?q=software%20engineer&n=5&a=0&i=1"></script>
 

if your open the url:

http://widget.workcircle.com/?q=software%20engineer&n=5&a=0&i=1
 

you will notice that it sends back javascript code which in turn uses document.write statements to create HTML markup. The variables/settings that you have above:
 

wc_background_color = "#ffffff";

wc_width = "150px";

wc_font = "10px verdana, arial, helvetica, sans-serif"

wc_font_color = "#996633";

wc_link_color = "#336699";

wc_border_color = "#D1E0F0";

wc_title_font = "12px Arial, Helvetica, Sans serif";

wc_title_font_color = "#ffffff";

wc_title_background_color = "#6699CC";

wc_title = 'Top UK Jobs';

<!-- Do not change this -->

wc_affiliate_id = 0;
 

is used on that HTML that is created dynamically. It controls the look and feel of that markup (fonts,colors).
 

Also, on the url you have:

q=software%20engineer&n=5&a=0&i=1
 

which the server on that site uses to search their db for jobs that meet that criteria.

Open in new window

0
 

Author Comment

by:jamie_2008
ID: 22669379
ok , i understand what the following code does ..

but i want to know ..how they generate the javascript code .?? this is the methodology that i want to know how it works ...


basically .. i want to code the javascript widgets  .. i have same type of website ..jobs search engine ..

i want to make a widget that everyone could use it on their website .. but how to do it ?




<script type="text/javascript" src="http://widget.workcircle.com/?q=software%20engineer&n=5&a=0&i=1"></script>

 

if your open the url:

http://widget.workcircle.com/?q=software%20engineer&n=5&a=0&i=1

Open in new window

0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 22740437
They have a server process (http://widget.workcircle.com/?q=software engineer&n=5&a=0&i=1) that does


header("content-type: text/javascript");

// some sql here

print "document.write('<table cellspacing=\"0\" cellpadding=\"5\">');\ndocument.write('<tr><td style=\"font:' + wc_font + ';\"><a target=\"_blank\" href=\"http://www.workcircle.com/?search=1&amp;query=software%20engineer&amp;j=23956116&amp;a=' + wc_affiliate_id + '\".... ";

Open in new window

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now