How to create specific pages for resources in my web page? - javascript

I was wondering what the best approach would be to create dynamic webpages based on data I have available?
I have a page which shows a table with information about certain countries, but there is more information I would like to show. What I want to achieve is that the user looks at the table and finds a land they want to know more about. When the user clicks on the country name for example, a new page should open with the data I provide. How to open a new page and all that is not what I'm asking for, but more how I would go about to achieve dynamically creating a html-page based on what the user clicks.
I have data on 150 countries, so I want to able to create the country specific pages on the fly, not manually creating 150 html-pages for the countries.
I hope that was clear enough, if not, please let me know!
Thanks in advance!

You have to use php and mysql.
add your countries in mysql
add data for each country in mysql
make html page table with all the countries and links for each country that send the viewer to page something like moreinfo.php?country=1
make the moreinfo.php page ,which depend on the number for country=
it will display the certain data
If you cant use php then you have to create files (pages) with the data for each country and on moreinfo.html execute javascript that will read the content of each file

Related

Connecting input text boxes on one website to the input text boxes on another website?

There is a website that I would like to pull data from, based on my user's search. The submit button and all inputs would be on my website and the results would be pulled from the website with the data, and have the results shown back on my website, for the user to see. The website that I would like to pull the data from has identical inputs.
Is it possible to connect input text boxes on one website to the input text boxes on another website and have the data requested appear back on my webpage?
Does anybody have any suggestions for doing this? Any ideas? I've never tried anything like this before, so if nothing else, it will be a good learning lesson.
You'll need a data scraper. PHP has Simple HTML DOM Parser: http://simplehtmldom.sourceforge.net/
Or you can use cURL: http://www.jacobward.co.uk/web-scraping-with-php-curl-part-1/
unless you have control over the server of the website you want to fetch data from, no you cannot.
or you can build yourself a HTML scraper .

ASP.NET MVC Facebook Style friend tags in textbox

I am not sure what it is called, but I am trying to replicate the facebook style tagging of friends in a post.
I would like it that when I start to type one of my customers names in, that it prompts to add the customer name to the post and is a hyperlink to the customer profile.
Anyone know what this might be called, or a way to achieve this?
Thanks
Mike
Basically, It is just a auto complete text box. As you type, Your code should read the text in the textbox, send it to some server page/api endpoints with this text and other relevant information needed. The server page will query your db table and return your friends name in a list to the caller and you need to display it in a list under the text box. You should have code when user select one item from that list to invoke some other js function where you will save it again to the db table (of tagged people) table.
Fortunately there are a lot of plugins available to do this. With minimal customization, you can achieve this. jQuery UI is a library you can look into. It has an Auto complete feature. There are a lot of other libraries too. A simple google search will help you to get started.

How to pass MySQL data from one page to another

Could someone point me in the right direction on how I could go about allowing a user to click a link on a PHP While Loop created MySQL table and pass that records info to another page. I've looked through all the similar questions and none answer mine. I am new to this type of programming.
Ultimately what my ideal scenario would be is this: Currently I have a list of data created with a While Loop. I would like a user to be able to click a text link that says REPORT ERROR. This in turn would take them to an error reporting form and populate a column of spans using getElementbyid... innerhtml. I know how to populate data with PHP on the same page but going to a new page is a different story.
Also as a newbie to Stackoverflow too, am I able to hire someone to do certain things for me?
pass data.
you can simply give the link of that page where you want to send your data and with a question mark you can pass whatever data you want to pass .if you want to pass multiple data use & between the data values. like below. i hope this will help you.

How to prepopulate few fields in a form, in a survey

I have a share point survey. When we responding to the survey, as we know, it will open NewForm.aspx. this page contains a ListFormWebpart in which questions from survey list will be displayed.
Now, i need to add few labels before the questions and these label values should be prepopulated from query string. What i am trying to achieve from this is, i wll created a link
with some values in query string and send to specific users. different users might have different values in query string. Whenever they click on the link, it should open the survey with prepopulated label values along with questions in list.
I am not sure, how to do it. I have tried to add some html control to web part(using share point designer) and through JavaScript i have tried to set query string values. Then i tried to put asp controls and trued. it didn't work. I am trying since last 2 days. No progress. I am using SharePoint 2003, WSS2.0
Can anybody, please help me to implement this solution.
You may find it easier to create a webpart with a custom form that enters data into the survey list.
The survey lists are useful as they are quite flexible, but your solution will likely make it hard to change your list in future. That means that a webpart specific for this survey may be a valid design decision for you.
An issue with your current implementation is that passing values specific to different users through the query string does not give you any guarantee that enterprising users will not change those values.
This may not really be an issue depending on your situation, but a custom control will allow you to query the current user and make decisions that way.
I have written some Java Script for reading query string, parsing and assigning values to controls based on their ControlID. I have used Content Editor Web Part to add this JavaScript to the Existing Survey page. Then this script has done job of prepopulating the fields.

dynamic navigation list menu

I am working on a small application and I basically need a list of 5 items say
Name
Address
City
Country
Zipcode
Whenever the user clicks on anyone of these he needs to be directed to another page and that particular item needs to be highlighted.
I want to do this dynamically. I have an idea that it can be done with javascript [document.getelementbyid()] but dont know exactly how.
are you trying to do something like this:
http://jqueryui.com/demos/tabs/
take a look at the AJAX example to get content from other pages

Categories