473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get Selected HTMl

59
Hi
Is it possible for a js or client side script to show the user any site that they enter, then let then select a certain area (possibly with a crop tool) and the script to get the html code for the selected area? how could i do this? any help would be really appreciated.

thanks
Apr 8 '08 #1
19 1744
acoder
16,027 Expert Mod 8TB
I've seen what you're looking for on Webwag: their Widget On Demand feature.
Apr 9 '08 #2
ojsimon
59
I've seen what you're looking for on Webwag: their Widget On Demand feature.
How would you go about doing this?
Apr 10 '08 #3
acoder
16,027 Expert Mod 8TB
Firstly, try using a cropper tool to get content from your own site. Search for one - you should find some good ones.

Once you get that working, you now need to get the other site from your domain to avoid cross-domain issues. To do that, make a Http request from the server-side to get the page onto your own domain.
Apr 10 '08 #4
ojsimon
59
Hi
How would you adjust the cropper tool to work with html though. It is my understanding they only work for images?
Thanks
Apr 11 '08 #5
acoder
16,027 Expert Mod 8TB
They use an image cropper (Defusion's), get the dimensions and use that to get the part of the page from the HTML. See the source code.
Apr 11 '08 #6
ojsimon
59
They use an image cropper (Defusion's), get the dimensions and use that to get the part of the page from the HTML. See the source code.
Sorry but i still dont understand how do you use dimensions, to crop html? and also will this update dynamicaly?

Thanks
Apr 11 '08 #7
acoder
16,027 Expert Mod 8TB
Look at the source code of webwag_sel.php. Use Firebug to inspect elements. Of course, this is only one site - there may be others with similar code.
Apr 12 '08 #8
ojsimon
59
Look at the source code of webwag_sel.php. Use Firebug to inspect elements. Of course, this is only one site - there may be others with similar code.
Hi
i've worked out that webwag is just using frames. I found this one which works how i would like mine too grid.orch8.net/
How can i make something like this?

Thanks
Apr 12 '08 #9
acoder
16,027 Expert Mod 8TB
They both use iframes, as would probably any similar website.

Interesting that they allow you to select elements rather than select an area of the page. If anything, that would be easier to implement.

Again, the source JavaScript files are there for you to look at. You may find more information on their blog.

I would suggest you start off with something small and simple and then extend it.
Apr 12 '08 #10
ojsimon
59
They both use iframes, as would probably any similar website.

Interesting that they allow you to select elements rather than select an area of the page. If anything, that would be easier to implement.

Again, the source JavaScript files are there for you to look at. You may find more information on their blog.

I would suggest you start off with something small and simple and then extend it.
Hi
I have got most of it to work extracting the javascripts but the one thing that doesnt work is when the site wont load in the selection interface, i think this requires php to fetch the html or contents, could you help me fix all this up? are you sure its using iframes, because when the widget is created the html is sometimes formated differently i think they are utilizing dom structure, or js to get php parsing points but i dont know?

Thanks

Thanks
Apr 12 '08 #11
acoder
16,027 Expert Mod 8TB
I have got most of it to work extracting the javascripts but the one thing that doesnt work is when the site wont load in the selection interface, i think this requires php to fetch the html or contents, could you help me fix all this up?
I mentioned about this earlier. You need to get the website content onto your domain before you can manipulate it. Use cURL - ask in the PHP forum for more details.
are you sure its using iframes, because when the widget is created the html is sometimes formated differently i think they are utilizing dom structure, or js to get php parsing points but i dont know?
They use iframes for the initial part, though you could use Ajax. The HTML might be formatted differently if it's within a parent container which isn't included or the CSS is not copied.
Apr 13 '08 #12
ojsimon
59
I mentioned about this earlier. You need to get the website content onto your domain before you can manipulate it. Use cURL - ask in the PHP forum for more details.
They use iframes for the initial part, though you could use Ajax. The HTML might be formatted differently if it's within a parent container which isn't included or the CSS is not copied.

Hi
I think this job is too complicated for me, would you do this freelance?

Thanks
Apr 13 '08 #13
acoder
16,027 Expert Mod 8TB
Not on this site, I'm afraid. You could try some popular freelance sites.

However, if you have a real job in mind with sufficient renumeration, put a job posting up in the IT Jobs forum.
Apr 14 '08 #14
ojsimon
59
Not on this site, I'm afraid. You could try some popular freelance sites.

However, if you have a real job in mind with sufficient renumeration, put a job posting up in the IT Jobs forum.

Ok so ive decided to continue with this as i cannot afford freelancing. Im having major problems getting the site to load though, there are quite a few files in the folder, can anyone help me get the site to load ? any help is really appreciated. if anyone has any resources which may help please tell me.

thanks
Olie
Apr 21 '08 #15
acoder
16,027 Expert Mod 8TB
Can you give a link to a test page?

Without seeing some code, it's difficult to say what the problem might be.
Apr 22 '08 #16
ojsimon
59
Ok here i have atached the files im trying.

thansk
Attached Files
File Type: zip grid.orch8.net 2.zip (270.2 KB, 538 views)
Apr 27 '08 #17
acoder
16,027 Expert Mod 8TB
Can you find the parts where you're having problems and show that code.

Remember that there's two parts to this. If you want help with the server-side part, ask in the appropriate forum, e.g. PHP. For the client-side (DHTML/JavaScript/Ajax) part, ask away here.
Apr 28 '08 #18
ojsimon
59
Can you find the parts where you're having problems and show that code.

Remember that there's two parts to this. If you want help with the server-side part, ask in the appropriate forum, e.g. PHP. For the client-side (DHTML/JavaScript/Ajax) part, ask away here.
ok i think this might need some server side to get the html, i can do this but i just dont know where to put it in this javascript ( i dont understand js) where should i put the code to get the site? I have tried adding it into the clipping page with no luck, what would the url array be in js and where should i put the php to get the site?

Thanks
Apr 28 '08 #19
acoder
16,027 Expert Mod 8TB
ok i think this might need some server side to get the html, i can do this but i just dont know where to put it in this javascript ( i dont understand js) where should i put the code to get the site? I have tried adding it into the clipping page with no luck, what would the url array be in js and where should i put the php to get the site?
Try not to worry about doing everything at once.

If you do it step by step and design your solution, you'll learn and understand more and also get each part working.

Firstly, see if you can get the selected part of a page from your own domain (forget about getting another website for now).
Apr 29 '08 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: maflu | last post by:
Hello, I am rather a beginner in Javascript and have the following problem. There is a drop down list on my Web page with various values to be selected by the user. Once the user has selected a...
15
by: TJ Walls | last post by:
Hello All, Is it possible to create a <select> element with no selected options? I have tried setting the selectedIndex attribute to -1, but as far as I can tell this only works for <select...
4
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by...
8
by: McKirahan | last post by:
Firefox does not reflect selected option via innerHTML How do I get Firefox to reflect selected option values? <html> <head> <title>FFinner.htm</title> <script type="text/javascript">...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
4
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The...
3
by: Patrick | last post by:
Hi All, Why does this work in Internet Explorer, but not Mozilla? I'm reading from a flat file. As an examle the value of colm1 read from the file is B. I set in the form page; <?php $A...
6
by: artev | last post by:
if I have a select with more options, how I can know if is there an option selected; is necessary a cycle? or is there an inner property?
9
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo...
5
by: Max | last post by:
Is there any way to set a select-multiple type <select multiple="multiple"with multiple selected options in scripting? Any idea about this is appreciative.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.