# Other Languages > jQuery >  [RESOLVED] JSON Not letting me post a URL?

## Static

How do you all a URL to pass thru json?

http:// is breaking it... im guessing its the // because if I remove one it works...



```
$('#save_social').click(function() {
                	$('.wait').show();
                  $('.wait').fadeIn(400).html('<img src="images/loading.gif" />');
                  var user_fb=$('#fb_name').val();
                  var user_tw=$('#tw_name').val();
                  var user_id=$('#usrid').val();
                  $.ajax({
                            type: "POST",
                            url: "functions/soc.php",
                            data: { fb: user_fb, tw: user_tw, uid: user_id },
                            dataType: "json",
                            cache: false,
                            success: function(result){
                            	if(result.stat=='fail'){
			                      		$('.wait').addClass("red");
			                      		$('.wait').fadeIn(400).html(result.query);
                            	}else{
                            		$('.wait').removeClass("red");
			                      		$('.wait').fadeIn(400).html("");
			                      		$('#edit_user').hide();
                            	}
                            }
                           });
                	
                });
```

----------


## sapator

I don't think php passes different than asp.net, as i pass it in the same way (for a service "myservice.svc/getfunction"). I am not sure though how would you pass this on remote domains. I think http:// is needed there + more stuff. So I am not sure on what of these your are trying here.

----------


## szlamany

Are you saying that you want to specify http:// here?



```
url: "functions/soc.php",
```

----------


## techgnome

JSON isn't the issue.
This is the JSON here: { fb: user_fb, tw: user_tw, uid: user_id } 
There's no URL in there anywhere. If you're talking about the same segment that szlamany is talking about "url: "functions/soc.php" that's just JS/AJAX, has nothing to do with JSON.

I think you're going to need to be a little more specific in your description.

-tg

----------


## Static

no lol

the VALUE of var user_fb=$('#fb_name').val(); will be a URL
so it breaks it as it tries to pass the url through json to the php... its like I need to escape the /'s but cant seem to make that work?

----------


## techgnome

Sounds like it might need to be encoded.
http://stackoverflow.com/questions/8...rome-extension

-tg

----------


## szlamany

I never have to deal with escaping data coming from the browser - have to worry about it the other way around.

Where is the error you are getting?  What error?  Backend error?  JS blowing up?

----------


## Static

I am not running it in a debugger  :Big Grin:  , but the JS is stopping right at the point it needs to send the data to the php file...
I will try encoding it...if you remove one / it works.  http:/blah.blah  - so its seeing the // as something odd

----------


## techgnome

well, can you assume the http:// ? I'm wondering if maybe you simply strip http:// off of the URL, send it over, then on the server add the http:// back in.  Just a thought.

-tg

----------


## Static

:Blush:  :Roll Eyes (Sarcastic): 


well... I suppose that might work....  Im going to go drink now. lol

----------

