Solved

php javascript widgets

Posted on 2008-10-07
7
304 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

746 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

13 Experts available now in Live!

Get 1:1 Help Now