cross domain web services/ wcf

I have created a simple wcf / c# web service and have cross domain issue.
And I understood that can be resolved by written codes in Jquery or change browser setting.
Is it any possibility to write codes inside of WCF codes to fix the issue?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you give an example of the code you are using and what error you are receiving?
ITsolutionWizardAuthor Commented:
I have below codes with cross domain issue in Chrome and Firefox.
And I did install below links from Chrome but still not working.

However, IE working with enable the cross domain under Internet Option >> Security Tab

Any ideas

function GetModelList(divisCode)
      var customerNo = "315217";            
        var GetModelListJSon = "";            
        $(document).ready(function () {
                cache: false,
                type: "GET",
                async: false,
                dataType: "json",
                contentType: 'text/plain',
                url: GetModelListJSon + encodeURIComponent("(011,115217)"),
                success: function (data) {
                    if (data == null)
                    resultObj = jQuery.parseJSON(data);
                    if (resultObj.Status != 'Failed') {
                error: function (xhr,status,error) {
                    alert(xhr.responseText + " : error GetModelListJSon");

I'm not sure how you will consume in WCF but for Web, there is package you can use it.
Alternatively below code also works:

HttpResponseMessage msg;

msg.Headers.Add("Access-Control-Allow-Origin", "*");
msg.Headers.Add("Access-Control-Allow-Credentials", true.ToString());
msg.Headers.Add("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS");
 msg.Headers.Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization, Location");
msg.Headers.Add("Access-Control-Expose-Headers", "Location");


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ITsolutionWizardAuthor Commented:
toakkiyadavm thank you for your codes samples. Actually, I already posted my codes. How should I merge yours to mine?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.