[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Facebook Like Syntax For Dynamic URL

Posted on 2011-02-22
13
Medium Priority
?
682 Views
Last Modified: 2012-06-27
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.swedishmotors.com%2Fcars%2Fpages%2Fcar_search_full_details.asp%3Fid%3D<%=rsData("strcarid")%>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=recommend&amp;font=tahoma&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

I am trying to get a facebook like link for a dymanic url - http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=582

I tried replacing the 582 with <%=rsData("strcarid")%> wihich holds the value.

If you visit the url you can see the error.

Thanks!
0
Comment
Question by:swedishmotors
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34954907
What exactly is the problem as when clicking on the above link I don't get an error.
Show us your link code in your asp so we can try and help
0
 
LVL 1

Author Comment

by:swedishmotors
ID: 34955206
<%response.write(Server.URLEncode("http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=" & strcarid))%>

 <iframe src="http://www.facebook.com/plugins/like.php?href=<%response.write(Server.URLEncode("http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=" & strcarid))%>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=recommend&amp;font=tahoma&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

I have update my code to URLEncode the link.
When you click the like button at the very bottom of the page, then unlike you get an error in the facebook feed.
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34956738
You have a " that doesn't have have a matching " here : height=80" , fixing that might fix the problem

if that doesn't work try :

dim url = "http://www.facebook.com/plugins/like.php?href="http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=" & strcarid & "&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=recommend&amp;font=tahoma&amp;colorscheme=light&amp;height='80' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:450px; height:80px;' allowTransparency='true'"

<iframe src=<%response.write(url)%></iframe
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
LVL 1

Author Comment

by:swedishmotors
ID: 34966818
Currently I have this:

<iframe src="http://www.facebook.com/plugins/like.php?href=<%response.write("http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=" & strcarid )%>3E&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;font=verdana&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px; allowTransparency="true"></iframe>

Facebook Error: The page at http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=5903E could not be reached.

I do not know where the 3E is coming from? http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=590 is the link to my page.
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34967016
You still have a " without a matching starting quote on the height attribute. colorscheme=light&amp;height=35"

I suggest you use the approach I said in my previous post
0
 
LVL 1

Author Comment

by:swedishmotors
ID: 34972579
I have tried that:

<iframe src="http://www.facebook.com/plugins/like.php?href=
<%response.write(Server.URLEncode("http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?"&(Request.QueryString)))%>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:35px; allowTransparency="true"></iframe>

I believe the problem is right here: ?"&(Request.QueryString)))%>
It is not pulling the QueryString.

0
 
LVL 1

Author Comment

by:swedishmotors
ID: 34972957
I have also tried this -
dim url
url= "http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=" & strcarid
response.write(url)


<--iframe src="http://www.facebook.com/plugins/like.php?href=<%response.write(url)%>3E&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;font=verdana&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px; allowTransparency="true"></iframe>

This returns-
<--iframe src="http://www.facebook.com/plugins/like.php?href=http://www.swedishmotors.com/cars/pages/car_search_full_details.asp?id=5903E&layout=standard&show_faces=false&width=450&action=recommend&font=verdana&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px; allowTransparency="true">
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34973009
You still don't have that quote in which is why the string is being closed after the height =35" change it to height='35'
and take out the 3E from <%response.write(url)%>3E
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34973030
or is that where the href is supposed to end? if so maybe you just need to take out the 3E ?
0
 
LVL 1

Author Comment

by:swedishmotors
ID: 34973161
It seems the iframe now load fine - but the functionality with facebook is not working - you get an error when you click like.  It is like Facebook is not interacting with the url correctly?
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34973323
The error is coming back as 'The page at http://swedishmotors.com/cars/pages/car_search_full_details.asp could not be reached.', i have no idea but it does seem to be a problem at facebooks end or as you say it is not interacting with the url correctly.
0
 
LVL 1

Accepted Solution

by:
swedishmotors earned 0 total points
ID: 34974258
I found this is the only way:

<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like show_faces="false" width="450" action="recommend"></fb:like>
0
 
LVL 1

Author Closing Comment

by:swedishmotors
ID: 35145526
I found the fb library is the only way to accomplish this.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

649 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