Jump to content

shobhitjain

Members
  • Posts

    73
  • Joined

  • Last visited

About shobhitjain

  • Birthday 01/26/1987

Profile Information

  • Location
    India

shobhitjain's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. No sir, it is not so.... java script:void((function(){var%20a=window.getSelection();var%20b=location.href.replace(/^http%5C:%5C/%5C/(.*)$/,'$1');var%20c=document.title;window.open('www.yourdomain.com?url=http://'+b+'&title='+c+'&text='+escape(a),'mydomain','height=500,width=400,left=100, top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');})())i am using this bookmarklet to capture url's ,,, catch here ,,means storing url to some file
  2. hey guys ,i am using javascript to capture URL of a webpage. but i encountered this webpage , which javascript is not capturinghttp://www.lonelyplanet.com/thorntree/thre...853892#12853892 i am using location.href.replace to catch url's
  3. Hey guys , i encountered a problem....The problem is like this...There are 3 textboxes ,when i click save , the data in the textboxes is saved to the server via xmlhttp-POST method..there is an option of adding more textboxes, when i add 5 more textboxes... how do i change the post request according to it. please help me...
  4. Hi Can anyone tell me how to wrap and truncate drop down list text.Suppose i have line of 1000 words ,so i just need to display 500 words,,,,in 2 lines....wrap it to other line and truncate exceeding line 2regardsshobhit
  5. hey guys i am bit confused in this problem suppose i have this code<ul><li><a href="http://www.weatherbase.com/weather/weather.php3?s=57219&refer= ">Johnston Island</a><li><a href="http://www.weatherbase.com/weather/weather.php3?s=66019&refer= ">Midway Island</a></ul><ul><li><a href="http://www.weatherbase.com/weather/weather.php3?s=158319&refer= ">Palmyra Atoll</a><li><a href="http://www.weatherbase.com/weather/weather.php3?s=54219&refer= ">Wake Island</a></ul>i scrape this text from the webpage to my localhost using Php simple html Dom.now i have to split all these links ,such that when i click on Midway Island the page is redirected to www.mypage.com.i don't know about using regex ,so how do i split this code to extract url and change it to my url.
  6. well thanksI have figured out the solution.Part 3 comes to be the value ,which i requiredpreg_match_all("/(<([\w]+)[^>]*>)(.*?)(<\/\\2>)/", $stripped_file, $matches, PREG_SET_ORDER); foreach ($matches as $val) { echo "matched: " . $val[0] . "\n"; echo "part 1: " . $val[1] . "\n"; echo "part 2: " . $val[2] . "\n"; echo "part 3: " . $val[3] . "\n"; echo "part 4: " . $val[4] . "\n\n";}Regards
  7. sorry to say, but i am usually confused in regular expressions.<td>fdsa<td>the table didn't have any class defined so i was confused that on which basis i should extract data.i am still not able to extract fdsa from the whole table...i dont need <td><td> tags just fdsa
  8. Hey guys i got stuck at one place .I am using simple_html_dom (sourceforge)for extracting contents of the page from a websitebut i got stuck when i tried to extract data from the tablehttp://www.weatherbase.com/weather/weather...6200&refer=this is the link of that website.i want that data ,my code was<?php $original_file = file_get_contents("http://www.weatherbase.com/weather/weather.php3?s=606200&refer="); // $stripped_file = strip_tags($original_file);// preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", $stripped_file, $matches);//preg_match_all('/<td class="[^"]+">([^<]*)<\/td>/', $stripped_file, $matches);//preg_match_all('/<td>(.*)a</td>/', $stripped_file, $matches); //DEBUGGING //$matches[0] now contains the complete A tags; ex: <a href="link">text</a> //$matches[1] now contains only the HREFs in the A tags; ex: link //header("Content-type: text/plain"); //Set the content type to plain text so the print below is easy to read! //print_r($matches); //View the array to see if it workedif(preg_match("#<table ([^>]*)>(.*?)</table>#is", $original_file, $matches)){ #echo '<pre>' . htmlentities(print_r($matches, true)) . '</pre>'; // get our table attributes $attr = explode(" ", $matches[1]); // echo out our attributes echo '<pre>' . htmlentities(print_r($attr, true)) . '</pre>';}?>i tried all combinations(in comments)but i don't know where i am wrong,,please help
  9. Sir, this script is neither related to proxies nor XHR i just wanted to provide the path by myself. not the path via upload button..well this is resolved.Thanks and Regards.
  10. it is on my hard-disk. I just need to provide path directly.not by clicking upload.i tried to change Above (#upload),i think it is getting the value when we click on the upload,
  11. hi guysThis code is working fineBut i don't wan't to access images via upload button.i just want to pass a defined value ,just when i click on the button it should take that value and upload that file.i have tried all combinations,but i am unable to find that where to put that path such that path provided by upload button can be replaced Please help<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head profile="http://gmpg.org/xfn/11"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>AJAX File Upload - Web Developer Plus Demos</title><script type="text/javascript" src="js/jquery-1.3.2.js" ></script><script type="text/javascript" src="js/ajaxupload.3.5.js" ></script><link rel="stylesheet" type="text/css" href="./styles.css" /><script type="text/javascript" > $(function(){ //var btnUpload=$('#upload'); var btnUpload=$('#upload'); var status=$('#status'); new AjaxUpload(btnUpload, { action: 'http://localhost/upload-file.php', name: 'uploadfile', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed status.text('Only JPG, PNG or GIF files are allowed'); return false; } }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response==="success"){ $('<li></li>').appendTo('#files').html('<img src="./uploads/'+file+'" alt="" /><br />'+file).addClass('success'); } else{ $('<li></li>').appendTo('#files').text(file).addClass('error'); } } }); });</script></head><body><input type="button" id="upload" /></body></html>
  12. Well i have found out the solution.here it is :i just need to change getElementByTagNameand typed there the fixed URL.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title></title><meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta http-equiv="imagetoolbar" content="false"><meta http-equiv="imagetoolbar" content="no"><script type="text/javascript" src="uploader.js"></script><script type="text/javascript">window.addEventListener("load", function() { // handle image preview var input = document.getElementById("photo"); // handle file upload var form = document.getElementsByTagName("form")[0]; var uploader = new Uploader(form); var uploadBtn = document.getElementById("upload"); uploadBtn.addEventListener("click", function() { uploader.send(); }, false);}, false);</script></head><body><form action="upload.php" method="post" enctype="multipart/form-data" onsubmit="return false;"> <fieldset> <input type="file" name="photo" id="photo"> <input type="submit" value="Upload" id="upload"> </fieldset></form></body></html>
  13. But i think that when we click on upload it just took the path of the file.Uploading is done when we click on submit.So if we mention the path of the file separately then after click it should upload...!!!!!!!!!!!!!!!Isn't it??????
  14. I need to Upload a single file to server folder. Just when i click on the button the script should send the image to the folder.The image path is described in the script.Please helpI am trying to make this thing in Javascript,Jquery or Ajax
  15. I made a simple script thatcheck the the value of the upload field, if null then textbox remains null,but if there is some value of upload field, the text box gets populated with that value.while if the value fiield is null,any value can be set to textbox manually
×
×
  • Create New...